Constructor and Description |
---|
Line(float[] x,
float[] y,
processing.core.PApplet parent)
Constructs a new line object with the given geometry.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(float px,
float py)
Tests whether the given point is located somewhere along the line feature.
|
void |
draw(Geographic transformer)
Draws the line in the parent sketch.
|
int |
getNumVertices()
Reports the number of vertices that make up the line feature.
|
FeatureType |
getType()
Report the type of feature (line).
|
float[] |
getXCoords()
Reports the x coordinates coordinates of the line feature.
|
float[] |
getYCoords()
Reports the y coordinates coordinates of the line feature.
|
void |
setRenderer(Drawable renderer)
Sets the renderer to be used for drawing this feature.
|
static void |
setTolerance(float tolerance)
Sets the tolerance values used for contains() testing.
|
public Line(float[] x, float[] y, processing.core.PApplet parent)
x
- x coordinates of the line.y
- y coordinates of the line.parent
- The parent sketch.public void draw(Geographic transformer)
public int getNumVertices()
getNumVertices
in interface Feature
public FeatureType getType()
public float[] getXCoords()
public float[] getYCoords()
public void setRenderer(Drawable renderer)
setRenderer
in interface Feature
renderer
- New renderer to use or null if default rendering is to be used.public static void setTolerance(float tolerance)
tolerance
- Tolerance distance in the same units as the line's coordinates.public boolean contains(float px, float py)