|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.triangulate.quadedge.QuadEdgeTriangle
public class QuadEdgeTriangle
Models a triangle formed from QuadEdge
s in a QuadEdgeSubdivision
which forms a triangulation. The class provides methods to access the
topological and geometric properties of the triangle and its neighbours in
the triangulation. Triangle vertices are ordered in CCW orientation in the
structure.
QuadEdgeTriangles support having an external data attribute attached to them. Alternatively, this class can be subclassed and attributes can be defined in the subclass. Subclasses will need to define their own BuilderVisitor class and createOn method.
Constructor Summary | |
---|---|
QuadEdgeTriangle(QuadEdge[] edge)
Creates a new triangle from the given edges. |
Method Summary | |
---|---|
boolean |
contains(Coordinate pt)
|
static boolean |
contains(QuadEdge[] tri,
Coordinate pt)
Tests whether the point pt is contained in the triangle defined by 3 QuadEdge es. |
static boolean |
contains(Vertex[] tri,
Coordinate pt)
Tests whether the point pt is contained in the triangle defined by 3 Vertex es. |
static java.util.List |
createOn(QuadEdgeSubdivision subdiv)
Creates QuadEdgeTriangle s for all facets of a
QuadEdgeSubdivision representing a triangulation. |
QuadEdgeTriangle |
getAdjacentTriangleAcrossEdge(int edgeIndex)
|
int |
getAdjacentTriangleEdgeIndex(int i)
|
Coordinate |
getCoordinate(int i)
|
Coordinate[] |
getCoordinates()
|
java.lang.Object |
getData()
Gets the external data value for this triangle. |
QuadEdge |
getEdge(int i)
|
int |
getEdgeIndex(QuadEdge e)
Gets the index for the given edge of this triangle |
int |
getEdgeIndex(Vertex v)
Gets the index for the edge that starts at vertex v. |
QuadEdge[] |
getEdges()
|
void |
getEdgeSegment(int i,
LineSegment seg)
|
Polygon |
getGeometry(GeometryFactory fact)
|
QuadEdgeTriangle[] |
getNeighbours()
Gets the neighbours of this triangle. |
java.util.List |
getTrianglesAdjacentToVertex(int vertexIndex)
Gets the triangles which are adjacent (include) to a given vertex of this triangle. |
Vertex |
getVertex(int i)
|
Vertex[] |
getVertices()
Gets the vertices for this triangle. |
boolean |
isBorder()
Tests whether this triangle is adjacent to the outside of the subdivision. |
boolean |
isBorder(int i)
|
boolean |
isLive()
|
void |
kill()
|
static int |
nextIndex(int index)
Finds the next index around the triangle. |
void |
setData(java.lang.Object data)
Sets the external data value for this triangle. |
static Geometry |
toPolygon(QuadEdge[] e)
|
static Geometry |
toPolygon(Vertex[] v)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QuadEdgeTriangle(QuadEdge[] edge)
edge
- an array of the edges of the triangle in CCW orderMethod Detail |
---|
public static java.util.List createOn(QuadEdgeSubdivision subdiv)
QuadEdgeTriangle
s for all facets of a
QuadEdgeSubdivision
representing a triangulation.
The data attributes of the QuadEdge
s in the subdivision
will be set to point to the triangle which contains that edge.
This allows tracing the neighbour triangles of any given triangle.
subdiv
- the QuadEdgeSubdivision to create the triangles on.
public static boolean contains(Vertex[] tri, Coordinate pt)
Vertex
es.
tri
- an array containing at least 3 Vertexespt
- the point to test
public static boolean contains(QuadEdge[] tri, Coordinate pt)
QuadEdge
es.
tri
- an array containing at least 3 QuadEdgespt
- the point to test
public static Geometry toPolygon(Vertex[] v)
public static Geometry toPolygon(QuadEdge[] e)
public static int nextIndex(int index)
index
-
public void setData(java.lang.Object data)
data
- an object containing external datapublic java.lang.Object getData()
public void kill()
public boolean isLive()
public QuadEdge[] getEdges()
public QuadEdge getEdge(int i)
public Vertex getVertex(int i)
public Vertex[] getVertices()
public Coordinate getCoordinate(int i)
public int getEdgeIndex(QuadEdge e)
e
- a QuadEdge
public int getEdgeIndex(Vertex v)
v
- the vertex to find the edge for
public void getEdgeSegment(int i, LineSegment seg)
public Coordinate[] getCoordinates()
public boolean contains(Coordinate pt)
public Polygon getGeometry(GeometryFactory fact)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isBorder()
public boolean isBorder(int i)
public QuadEdgeTriangle getAdjacentTriangleAcrossEdge(int edgeIndex)
public int getAdjacentTriangleEdgeIndex(int i)
public java.util.List getTrianglesAdjacentToVertex(int vertexIndex)
vertexIndex
- the vertex to query
public QuadEdgeTriangle[] getNeighbours()
null
|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |