public class MannTriangulator extends java.lang.Object implements Triangulator
| Modifier and Type | Class and Description |
|---|---|
protected class |
MannTriangulator.PointBag
A bag/pool of point objects
|
| Modifier and Type | Field and Description |
|---|---|
protected MannTriangulator.PointBag |
contour
The outer countour of the shape
|
protected MannTriangulator.PointBag |
holes
The holes defined in the polygon
|
| Constructor and Description |
|---|
MannTriangulator()
Creates a new instance of Triangulator0
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPolyPoint(float x,
float y)
Add a point that forms part of the outer polygon
|
int |
getTriangleCount()
Get a count of the number of triangles produced
|
float[] |
getTrianglePoint(int tri,
int i)
Get a point on a specified generated triangle
|
void |
reset()
Reset the internal state of the triangulator
|
void |
startHole()
Start a hole in the polygon
|
boolean |
triangulate()
Run the triangulation
|
protected MannTriangulator.PointBag contour
protected MannTriangulator.PointBag holes
public MannTriangulator()
public void addPolyPoint(float x,
float y)
TriangulatoraddPolyPoint in interface Triangulatorx - The x coordinate of the pointy - The y coordiante of the pointpublic void reset()
public void startHole()
TriangulatorstartHole in interface Triangulatorpublic boolean triangulate()
Triangulatortriangulate in interface Triangulatorpublic int getTriangleCount()
TriangulatorgetTriangleCount in interface Triangulatorpublic float[] getTrianglePoint(int tri,
int i)
TriangulatorgetTrianglePoint in interface Triangulatortri - The index of the triangle to interegatei - The index of the point within the triangle to retrieve
(0 - 2)