|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.umd.cfar.lamp.viper.geometry.PolyList
edu.umd.cfar.lamp.viper.geometry.Polygon
This class represents a series of line segments.
| Field Summary |
| Fields inherited from class edu.umd.cfar.lamp.viper.geometry.PolyList |
area, bbox, CARVE_POLYS, composed, originals, polys |
| Fields inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable |
EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST |
| Constructor Summary | |
Polygon()
Constructs an empty, closed polygon. |
|
Polygon(java.awt.geom.Point2D[] list)
Converts a list of points into a polygon. |
|
Polygon(Polygon old)
Constructs a Polygon copy. |
|
Polygon(java.lang.String S)
Constructs a polygon from a list of points. |
|
| Method Summary | |
boolean |
addVertex(Pnt v)
Adds the point to the end of the polygon as a point on its exterior. |
java.lang.Object |
clone()
Constructs a copy of this object. |
boolean |
equals(java.lang.Object o)
Tests to see if the other object contains the same region as this polygon. |
BoundingBox |
getBoundingBox()
Gets the closest bounding box surrounding this polygon. |
Pnt |
getCentroid()
Gets a copy of the centroid. |
java.util.Iterator |
getPoints()
Gets all the points around the outside of the polygon. |
protected void |
initBbox()
Creates a BoundingBox around this, for use by getBoundingBox, etc. |
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. |
Moveable |
shift(int x,
int y)
Shifts the moveable by the given amount. |
java.lang.String |
toString()
Gets a list of the points as a String, usually for debugging. |
static Polygon |
valueOf(java.lang.String S)
Constructs a polygon from a list of points. |
| Methods inherited from class edu.umd.cfar.lamp.viper.geometry.PolyList |
addPoly, area, clearPolyList, contains, getConvexPolygonArray, getFragmentationCount, getIntersection, getOriginals, getPolys, hashCode, intersection, intersects, toStringListOfPoints, union |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Polygon()
public Polygon(Polygon old)
old - The Polygon to copy.public Polygon(java.awt.geom.Point2D[] list)
list - ordered set of points for the polygon
public Polygon(java.lang.String S)
throws BadDataException
S - a polygon is a list of parenthestized int pairs, and
a set of polygons is delimited by brackets
BadDataException - if the string isn't formatted properly| Method Detail |
public static Polygon valueOf(java.lang.String S)
S - a polygon is a list of parenthestized int pairs, and
a set of polygons is delimited by brackets
public boolean equals(java.lang.Object o)
equals in class PolyListo - the PolyList or Polygon to compare with
public java.lang.Object clone()
clone in class PolyListpublic java.lang.String toString()
toString in class PolyListprotected void initBbox()
initBbox in class PolyListpublic BoundingBox getBoundingBox()
getBoundingBox in class PolyListpublic java.util.Iterator getPoints()
getPoints in class PolyListpublic boolean addVertex(Pnt v)
addVertex in class PolyListv - the point to add to the edge list
public Pnt getCentroid()
HasCentroid
getCentroid in interface HasCentroidHasCentroid.getCentroid()
public Moveable move(int direction,
int distance)
move in interface Moveabledirection - the direction to move the itemdistance - the distance to move it
public Moveable shift(int x,
int y)
shift in interface Moveablex - y -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||