Constructor and Description |
---|
Polygon(float[] x,
float[] y,
processing.core.PApplet parent)
Constructs a new polygon object with the given geometry.
|
Polygon(processing.core.PApplet parent)
Constructs a new polygon object with the default geometry.
|
Modifier and Type | Method and Description |
---|---|
void |
addPart(float[] x,
float[] y)
Adds a new part to the polygon.
|
boolean |
contains(float geoX,
float geoY)
Tests whether the given point is contained within the polygon.
|
void |
draw(Geographic transformer)
Draws the polygon in the parent sketch.
|
int |
getNumVertices()
Reports the number of vertices that make up the polygon feature.
|
java.util.ArrayList<java.lang.Integer> |
getSubPartPointers()
Reports pointers to the vertex index for each of the partss that make up the polygon feature.
|
FeatureType |
getType()
Report the type of feature (polygon).
|
float[] |
getXCoords()
Reports the x coordinates coordinates of the polygon feature.
|
float[] |
getYCoords()
Reports the y coordinates coordinates of the polygon feature.
|
void |
setRenderer(Drawable renderer)
Sets the renderer to be used for drawing this feature.
|
public Polygon(processing.core.PApplet parent)
parent
- The parent sketch.public Polygon(float[] x, float[] y, processing.core.PApplet parent)
x
- x coordinates of the polygon.y
- y coordinates of the polygon.parent
- The parent sketch.public void addPart(float[] x, float[] y)
x
- x coordinates of the polygon.y
- y coordinates of the polygon.public void setRenderer(Drawable renderer)
setRenderer
in interface Feature
renderer
- New renderer to use or null if default rendering is to be used.public void draw(Geographic transformer)
public int getNumVertices()
getNumVertices
in interface Feature
public java.util.ArrayList<java.lang.Integer> getSubPartPointers()
public float[] getXCoords()
public float[] getYCoords()
public FeatureType getType()
public boolean contains(float geoX, float geoY)