|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.geometry.Squiggle
Represents a squiggly line as a list of connected line segments.
Field Summary |
Fields inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable |
EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST |
Constructor Summary | |
Squiggle()
Constructs the empty squiggle. |
|
Squiggle(java.lang.String S)
Constructs a new squiggle from the given list of parenthesized points. |
Method Summary | |
void |
addPoint(Pnt p)
Adds a new point at the end of the squiggle. |
java.lang.Object |
clone()
Copies the squiggle. |
boolean |
diagonalie(Pnt a,
Pnt b)
Determines if the segment ab is a diagonal that doesn't intersect the edge. |
BoundingBox |
getBoundingBox()
Gets the closest bounding box around the squiggle. |
java.util.Iterator |
getPoints()
Gets an iterator through all the (@link Pnt} objects making up the squiggle. |
boolean |
isClockwise()
Determine the direction of the points in the squiggle, assuming a closed squiggle. |
Moveable |
move(int direction,
int distance)
Creates a new copy of this movable item, shifted in the given direction by the given number of pixels. |
Squiggle |
reverse()
Returns this squiggle, with the points in the opposite order. |
Moveable |
shift(int x,
int y)
Shifts the moveable by the given amount. |
java.lang.String |
toString()
Gets a string representation. |
java.util.List |
triangulate()
Returns a list of triangle polygons that, together,
tile the interior of this squiggle. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Squiggle()
public Squiggle(java.lang.String S) throws BadDataException
S
- a string in the form
(x y) ...
BadDataException
Method Detail |
public java.lang.Object clone()
public java.lang.String toString()
public BoundingBox getBoundingBox()
public java.util.Iterator getPoints()
public void addPoint(Pnt p)
p
- the point to add.public Moveable move(int direction, int distance)
Moveable
move
in interface Moveable
direction
- the direction to move the itemdistance
- the distance to move it
public Moveable shift(int x, int y)
Moveable
shift
in interface Moveable
x
- y
-
public Squiggle reverse()
public boolean isClockwise()
public java.util.List triangulate()
triangle polygons
that, together,
tile the interior of this squiggle.
public boolean diagonalie(Pnt a, Pnt b)
a
- b
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |