|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.chart.client.draw.Polygon
public class Polygon
Represents a polygon. Provides helper functions for intersection detection.
| Constructor Summary | |
|---|---|
Polygon()
Creates an empty polygon. |
|
Polygon(Polygon polygon)
Creates a clone of the given polygon. |
|
Polygon(PrecisePoint... points)
Creates a polygon using the given points. |
|
Polygon(PreciseRectangle rectangle)
Creates a polygon using the given rectangle |
|
| Method Summary | |
|---|---|
void |
addVertex(double x,
double y)
Adds a vertex to the polygon using the given coordinates. |
void |
addVertex(PrecisePoint vertex)
Adds the vertex to the polygon. |
boolean |
equals(Polygon polygon)
Returns true if the vertices of the given polygon are exactly equal to this polygon. |
boolean |
equalsNoPrecision(Polygon polygon)
Returns true if the vertices of the given polygon are nearly equal to this polygon. |
PrecisePoint |
getVertex(int index)
Returns the vertex at the provided index. |
Polygon |
intersect(Polygon clipPolygon)
Intersection of polygons calculated using the Sutherland-Hodgman algorithm. |
void |
removeVertex(int index)
Removes the vertex at the given index. |
int |
size()
Returns the number of vertices in the polygon |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Polygon()
public Polygon(Polygon polygon)
polygon - the polygon to clonepublic Polygon(PrecisePoint... points)
points - the points to add to the polygonpublic Polygon(PreciseRectangle rectangle)
rectangle - the rectangle used to create the polygon| Method Detail |
|---|
public void addVertex(double x,
double y)
x - the x coordinate of the vertexy - the y coordinate of the vertexpublic void addVertex(PrecisePoint vertex)
vertex - the vertex to be addedpublic boolean equals(Polygon polygon)
polygon - the polygon to be compared
public boolean equalsNoPrecision(Polygon polygon)
polygon - the polygon to be compared
public PrecisePoint getVertex(int index)
index - the index of the vertex
public Polygon intersect(Polygon clipPolygon)
clipPolygon - must be convex
public void removeVertex(int index)
index - the index to be removedpublic int size()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||