|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.franz.ag.Polygon
This class is used to represent a collection of point coordinates that form a polygon in 2-dimensional space.
A Polygon is represented in a triple store as a collection of triples, all with the same subject. The predicates are generated by the implementation and identify the point coordinates. The objects of the triples are encoded vertex coordinates.
| Constructor Summary | |
Polygon(int vertices)
Create an empty Polygon instance with room for a given number of vertices. |
|
| Method Summary | |
UPI |
add(AllegroGraph ag)
Add the polygon to a triple store. |
void |
addVertex(double x,
double y)
Add one pair of vertex coordinates to the Polygon. |
void |
get(AllegroGraph ag)
Retrieve the coordinates of this polygon from the triple store. |
boolean |
getModified()
Query the state of a Polygon instance. |
double[] |
getPoints()
Get the array of coordinates for the points in the Polygon. |
UPI |
getSubject()
Query the subject that identifies the triples in a polygon. |
GeospatialSubtype |
getSubtype()
Get the GeospatialSubtype associated with all the points in the Polygon instance. |
boolean |
pointInside(double x,
double y)
Query whether a point is inside a polygon. |
boolean[] |
pointsInside(double[] xy)
Query whether some points are inside a polygon. |
boolean[] |
pointsInside(double[] x,
double[] y)
Query whether some points are inside a polygon. |
void |
setSubject(UPI subject)
Set the subject that identifies the triples in a polygon. |
void |
setSubtype(GeospatialSubtype subtype)
Set the GeospatialSubtype associated with all the points in the Polygon instance. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Polygon(int vertices)
vertices - the number of vertices in the Polygon.| Method Detail |
public GeospatialSubtype getSubtype()
public void setSubtype(GeospatialSubtype subtype)
subtype - the GeospatialSubtypepublic double[] getPoints()
public boolean getModified()
public UPI getSubject()
public void setSubject(UPI subject)
subject - the subject to set
public void addVertex(double x,
double y)
x - y -
public UPI add(AllegroGraph ag)
throws AllegroGraphException
ag - The triple store.
AllegroGraphException
public void get(AllegroGraph ag)
throws AllegroGraphException
ag - the triple store
AllegroGraphException
public boolean pointInside(double x,
double y)
throws AllegroGraphException
x - y -
AllegroGraphException
public boolean[] pointsInside(double[] xy)
throws AllegroGraphException
xy - An array of alternating x and y coordinates
AllegroGraphException
public boolean[] pointsInside(double[] x,
double[] y)
throws AllegroGraphException
x - An array of x coordinatesy - An array of y coordinates
The two arrays must of the same length.
AllegroGraphException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||