Search Results for

    Show / Hide Table of Contents

    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
    object
    QuadEdgeTriangle
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Triangulate.QuadEdge
    Assembly: NetTopologySuite.dll
    Syntax
    public class QuadEdgeTriangle
    Remarks

    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.

    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
    Type Description
    object

    Methods

    | Edit this page View Source

    Contains(Coordinate)

    Declaration
    public bool Contains(Coordinate pt)
    Parameters
    Type Name Description
    Coordinate pt
    Returns
    Type Description
    bool
    | 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
    Type Description
    IList<QuadEdgeTriangle>

    A List of the created QuadEdgeTriangles

    | Edit this page View Source

    GetAdjacentTriangleAcrossEdge(int)

    Declaration
    public QuadEdgeTriangle GetAdjacentTriangleAcrossEdge(int edgeIndex)
    Parameters
    Type Name Description
    int edgeIndex
    Returns
    Type Description
    QuadEdgeTriangle
    | Edit this page View Source

    GetAdjacentTriangleEdgeIndex(int)

    Declaration
    public int GetAdjacentTriangleEdgeIndex(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    int
    | Edit this page View Source

    GetCoordinate(int)

    Declaration
    public Coordinate GetCoordinate(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    Coordinate
    | Edit this page View Source

    GetCoordinates()

    Declaration
    public Coordinate[] GetCoordinates()
    Returns
    Type Description
    Coordinate[]
    | Edit this page View Source

    GetEdge(int)

    Declaration
    public QuadEdge GetEdge(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    QuadEdge
    | 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
    Type Name Description
    int i
    LineSegment seg
    | Edit this page View Source

    GetEdges()

    Declaration
    public QuadEdge[] GetEdges()
    Returns
    Type Description
    QuadEdge[]
    | Edit this page View Source

    GetGeometry(GeometryFactory)

    Declaration
    public Geometry GetGeometry(GeometryFactory fact)
    Parameters
    Type Name Description
    GeometryFactory fact
    Returns
    Type Description
    Geometry
    | 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
    Type Description
    IList<QuadEdgeTriangle>

    A list of the vertex-adjacent triangles

    | Edit this page View Source

    GetVertex(int)

    Declaration
    public Vertex GetVertex(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    Vertex
    | 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
    public bool IsBorder()
    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
    Type Description
    bool
    | Edit this page View Source

    IsLive()

    Declaration
    public bool IsLive()
    Returns
    Type Description
    bool
    | Edit this page View Source

    Kill()

    Declaration
    public void Kill()
    | Edit this page View Source

    ToPolygon(QuadEdge[])

    Declaration
    public static Geometry ToPolygon(QuadEdge[] e)
    Parameters
    Type Name Description
    QuadEdge[] e
    Returns
    Type Description
    Geometry
    | Edit this page View Source

    ToPolygon(Vertex[])

    Declaration
    public static Geometry ToPolygon(Vertex[] v)
    Parameters
    Type Name Description
    Vertex[] v
    Returns
    Type Description
    Geometry
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX