public class QuadEdgeTriangle extends Object
QuadEdges 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 and Description |
|---|
QuadEdgeTriangle(QuadEdge
Creates a new triangle from the given edges.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Coordinate
|
static boolean |
contains(QuadEdge
Tests whether the point pt is contained in the triangle defined by 3
QuadEdgees.
|
static boolean |
contains(Vertex
Tests whether the point pt is contained in the triangle defined by 3
Vertexes.
|
static List |
createOn(QuadEdgeSubdivision
Creates
QuadEdgeTriangles for all facets of a
QuadEdgeSubdivision representing a triangulation.
|
QuadEdgeTriangle |
getAdjacentTriangleAcrossEdge(int edgeIndex)
|
int |
getAdjacentTriangleEdgeIndex(int i)
|
Coordinate |
getCoordinate(int i)
|
Coordinate |
getCoordinates()
|
Object |
getData()
Gets the external data value for this triangle.
|
QuadEdge |
getEdge(int i)
|
int |
getEdgeIndex(QuadEdge
Gets the index for the given edge of this triangle
|
int |
getEdgeIndex(Vertex
Gets the index for the edge that starts at vertex v.
|
QuadEdge |
getEdges()
|
void |
getEdgeSegment(int i, LineSegment
|
Polygon |
getGeometry(GeometryFactory
|
QuadEdgeTriangle |
getNeighbours()
Gets the neighbours of this triangle.
|
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(Object
Sets the external data value for this triangle.
|
static Geometry |
toPolygon(QuadEdge
|
static Geometry |
toPolygon(Vertex
|
String |
toString()
|
public QuadEdgeTriangle(QuadEdge[] edge)
edge - an array of the edges of the triangle in CCW order
public static ListcreateOn(QuadEdgeSubdivision subdiv)
QuadEdgeTriangles for all facets of a
QuadEdgeSubdivision representing a triangulation. The
data attributes of the
QuadEdges 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)
Vertexes.
tri - an array containing at least 3 Vertexes
pt - the point to test
public static boolean contains(QuadEdge[] tri, Coordinate pt)
QuadEdgees.
tri - an array containing at least 3 QuadEdges
pt - the point to test
public static int nextIndex(int index)
index -
public void setData(Objectdata)
data - an object containing external data
public ObjectgetData()
public void kill()
public boolean isLive()
public QuadEdge[] getEdges()
public QuadEdgegetEdge(int i)
public VertexgetVertex(int i)
public Vertex[] getVertices()
public CoordinategetCoordinate(int i)
public int getEdgeIndex(QuadEdgee)
e - a QuadEdge
public int getEdgeIndex(Vertexv)
v - the vertex to find the edge for
public void getEdgeSegment(int i,
LineSegment seg) public Coordinate[] getCoordinates()
public boolean contains(Coordinatept)
public PolygongetGeometry(GeometryFactory fact)
public StringtoString()
public boolean isBorder()
public boolean isBorder(int i)
public QuadEdgeTrianglegetAdjacentTriangleAcrossEdge(int edgeIndex)
public int getAdjacentTriangleEdgeIndex(int i)
public ListgetTrianglesAdjacentToVertex(int vertexIndex)
vertexIndex - the vertex to query
public QuadEdgeTriangle[] getNeighbours()
null