|
|||||||||||
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.PolyList
This class represents the intersection / union of several Convex Polygons. ConvexPolygon extends this, and if I ever have non-convex polygons, they should, too.
Field Summary | |
protected Rational |
area
The area. |
protected BoundingBox |
bbox
A BoundingBox that surrounds the PolyList. |
static boolean |
CARVE_POLYS
This boolean should be set to 'false' to avoid carving polygons into simple polygons. |
protected boolean |
composed
If true, then it is composed, and need to watch for redundancies. |
protected java.util.List |
originals
While the polys list has no overlaps, the originals list does not. |
protected java.util.List |
polys
The list of convex polygons that this data structure describes. |
Constructor Summary | |
PolyList()
Constructs an empty PolyList. |
|
PolyList(PolyList old)
Constructs a PolyList copy of an old PolyList. |
Method Summary | |
protected void |
addPoly(PolyList shape)
Sets this PolyList into this unioned with the given shape. |
boolean |
addVertex(Pnt p)
Adds the vertex to the polygon this represents; this is unimplemented in this root class. |
Rational |
area()
Get the area of coverage by these polygons. |
protected void |
clearPolyList()
|
java.lang.Object |
clone()
Constructs a copy of this object. |
boolean |
contains(Pnt point)
Tests to see if one of the subpolys contains the given point. |
boolean |
equals(java.lang.Object other)
Checks to see if this equals the other space. |
BoundingBox |
getBoundingBox()
Gets the closest box around the set of polygons. |
ConvexPolygon[] |
getConvexPolygonArray()
Gets an array of non-overlapping ConvexPolygons whose union completely tiles the region described by this PolyList. |
int |
getFragmentationCount(PolyList other)
Gets a count of how many original polygons the other hits. |
PolyList |
getIntersection(PolyList other)
Get the intersection of this PolyList with another. |
java.util.Iterator |
getOriginals()
Gets the original list of polygons added to this list, instead of the list of non-overlapping ones. |
java.util.Iterator |
getPoints()
Gets the points in the polygon; to be implemented by the concrete subclasses. |
protected java.util.Iterator |
getPolys()
Gets an iterator that goes through a list of polygons that are contained within this region, such that the union of all of them is equal to this region. |
int |
hashCode()
Get a hashcode for this region. |
protected void |
initBbox()
Creates a BoundingBox around this, for use by getBoundingBox, etc. |
static PolyList |
intersection(PolyList alpha,
PolyList zappa)
Find the intersection of two PolyLists. |
boolean |
intersects(PolyList other)
Tests to see if this region intersects the given region. |
java.lang.String |
toString()
Returns a string representation of this list of convex polygons. |
java.lang.String |
toStringListOfPoints()
Gets a list of the points as a String, usually for debugging. |
static PolyList |
union(PolyList alpha,
PolyList zappa)
Generate the union of two PolyLists. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean composed
protected java.util.List polys
protected java.util.List originals
protected BoundingBox bbox
protected Rational area
public static boolean CARVE_POLYS
Constructor Detail |
public PolyList()
public PolyList(PolyList old)
old
- The PolyList to copy.Method Detail |
public java.lang.Object clone()
public boolean equals(java.lang.Object other)
other
- The object to test with.
true
if they are equal.public int hashCode()
public java.lang.String toStringListOfPoints()
public java.lang.String toString()
toStringListOfPoints()
right now.public Rational area()
public static PolyList union(PolyList alpha, PolyList zappa)
alpha
- A region of 2-dimensional space to unify.zappa
- Another region of 2-dimensional space to unify.
public static PolyList intersection(PolyList alpha, PolyList zappa)
alpha
- A region of 2-dimensional space.zappa
- Another region of 2-dimensional space to intersect with.
public PolyList getIntersection(PolyList other)
other
- The region to intersect with.
protected void initBbox()
public BoundingBox getBoundingBox()
protected java.util.Iterator getPolys()
public java.util.Iterator getOriginals()
public boolean contains(Pnt point)
point
- the point to test for
protected void clearPolyList()
protected void addPoly(PolyList shape)
shape
- the region to add to this.public ConvexPolygon[] getConvexPolygonArray()
public int getFragmentationCount(PolyList other)
other
- the polygon to test against
public boolean intersects(PolyList other)
other
-
public java.util.Iterator getPoints()
public boolean addVertex(Pnt p) throws BadDataException
p
- the point to add
BadDataException
- if the point cannot be added
java.lang.UnsupportedOperationException
- in this root class
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |