Class QuadEdgeTriangle
Models a triangle formed from 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.
Inheritance
QuadEdgeTriangle
Assembly: NetTopologySuite.dll
Syntax
public class QuadEdgeTriangle
Constructors
|
Edit this page
View Source
QuadEdgeTriangle(QuadEdge[])
Creates a new triangle from the given edges.
Declaration
public QuadEdgeTriangle(QuadEdge[] edge)
Parameters
Type |
Name |
Description |
QuadEdge[] |
edge |
An array of the edges of the triangle in CCW order
|
Properties
|
Edit this page
View Source
Data
Gets or sets the external data value for this triangle.
Declaration
public object Data { get; set; }
Property Value
Methods
|
Edit this page
View Source
Contains(Coordinate)
Declaration
public bool Contains(Coordinate pt)
Parameters
Returns
|
Edit this page
View Source
Contains(QuadEdge[], Coordinate)
Tests whether the point pt is contained in the triangle defined by 3 QuadEdgees.
Declaration
public static bool Contains(QuadEdge[] tri, Coordinate pt)
Parameters
Type |
Name |
Description |
QuadEdge[] |
tri |
an array containing at least 3 QuadEdges
|
Coordinate |
pt |
the point to test
|
Returns
Type |
Description |
bool |
true if the point is contained in the triangle
|
|
Edit this page
View Source
Contains(Vertex[], Coordinate)
Tests whether the point pt is contained in the triangle defined by 3 Vertexes.
Declaration
public static bool Contains(Vertex[] tri, Coordinate pt)
Parameters
Type |
Name |
Description |
Vertex[] |
tri |
an array containing at least 3 Vertexes
|
Coordinate |
pt |
the point to test
|
Returns
Type |
Description |
bool |
true if the point is contained in the triangle
|
|
Edit this page
View Source
CreateOn(QuadEdgeSubdivision)
Creates 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.
Declaration
public static IList<QuadEdgeTriangle> CreateOn(QuadEdgeSubdivision subdiv)
Parameters
Type |
Name |
Description |
QuadEdgeSubdivision |
subdiv |
The QuadEdgeSubdivision to create the triangles on.
|
Returns
|
Edit this page
View Source
GetAdjacentTriangleAcrossEdge(int)
Declaration
public QuadEdgeTriangle GetAdjacentTriangleAcrossEdge(int edgeIndex)
Parameters
Type |
Name |
Description |
int |
edgeIndex |
|
Returns
|
Edit this page
View Source
GetAdjacentTriangleEdgeIndex(int)
Declaration
public int GetAdjacentTriangleEdgeIndex(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
|
Edit this page
View Source
GetCoordinate(int)
Declaration
public Coordinate GetCoordinate(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
|
Edit this page
View Source
GetCoordinates()
Declaration
public Coordinate[] GetCoordinates()
Returns
|
Edit this page
View Source
GetEdge(int)
Declaration
public QuadEdge GetEdge(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
|
Edit this page
View Source
GetEdgeIndex(QuadEdge)
Gets the index for the given edge of this triangle
Declaration
public int GetEdgeIndex(QuadEdge e)
Parameters
Type |
Name |
Description |
QuadEdge |
e |
a QuadEdge
|
Returns
Type |
Description |
int |
the index of the edge in this triangle,
or -1 if the edge is not an edge of this triangle
|
|
Edit this page
View Source
GetEdgeIndex(Vertex)
Gets the index for the edge that starts at vertex v.
Declaration
public int GetEdgeIndex(Vertex v)
Parameters
Type |
Name |
Description |
Vertex |
v |
the vertex to find the edge for
|
Returns
Type |
Description |
int |
the index of the edge starting at the vertex,
or -1 if the vertex is not in the triangle
|
|
Edit this page
View Source
GetEdgeSegment(int, LineSegment)
Declaration
public void GetEdgeSegment(int i, LineSegment seg)
Parameters
|
Edit this page
View Source
GetEdges()
Declaration
public QuadEdge[] GetEdges()
Returns
|
Edit this page
View Source
GetGeometry(GeometryFactory)
Declaration
public Geometry GetGeometry(GeometryFactory fact)
Parameters
Returns
|
Edit this page
View Source
GetNeighbours()
Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is
null
Declaration
public QuadEdgeTriangle[] GetNeighbours()
Returns
Type |
Description |
QuadEdgeTriangle[] |
an array containing the 3 neighbours of this triangle
|
|
Edit this page
View Source
GetTrianglesAdjacentToVertex(int)
Gets the triangles which are adjacent (include) to a
given vertex of this triangle.
Declaration
public IList<QuadEdgeTriangle> GetTrianglesAdjacentToVertex(int vertexIndex)
Parameters
Type |
Name |
Description |
int |
vertexIndex |
The vertex to query
|
Returns
|
Edit this page
View Source
GetVertex(int)
Declaration
public Vertex GetVertex(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
|
Edit this page
View Source
GetVertices()
Gets the vertices for this triangle.
Declaration
public Vertex[] GetVertices()
Returns
Type |
Description |
Vertex[] |
a new array containing the triangle vertices
|
|
Edit this page
View Source
IsBorder()
Tests whether this triangle is adjacent to the outside of the subdivision.
Declaration
Returns
Type |
Description |
bool |
true if the triangle is adjacent to the subdivision exterior
|
|
Edit this page
View Source
IsBorder(int)
Declaration
public bool IsBorder(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
|
Edit this page
View Source
IsLive()
Declaration
Returns
|
Edit this page
View Source
Kill()
Declaration
|
Edit this page
View Source
ToPolygon(QuadEdge[])
Declaration
public static Geometry ToPolygon(QuadEdge[] e)
Parameters
Returns
|
Edit this page
View Source
ToPolygon(Vertex[])
Declaration
public static Geometry ToPolygon(Vertex[] v)
Parameters
Type |
Name |
Description |
Vertex[] |
v |
|
Returns
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides