Class QuadEdge
A class that represents the edge data structure which implements the quadedge algebra. The quadedge algebra was described in a well-known paper by Guibas and Stolfi, "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", ACM Transactions on Graphics, 4(2), 1985, 75-123.
Each edge object is part of a quartet of 4 edges, linked via their Rot references. Any edge in the group may be accessed using a series of Rot operations. Quadedges in a subdivision are linked together via their Next references. The linkage between the quadedge quartets determines the topology of the subdivision.
The edge class does not contain separate information for vertices or faces; a vertex is implicitly defined as a ring of edges (created using the Next field).
Inherited Members
Namespace: NetTopologySuite.Triangulate.QuadEdge
Assembly: NetTopologySuite.dll
Syntax
public class QuadEdge
Properties
| Edit this page View SourceDNext
Gets the next CCW edge around (into) the destination of this edge.
Declaration
public QuadEdge DNext { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Get the next destination edge.
DPrev
Gets the next CW edge around (into) the destination of this edge.
Declaration
public QuadEdge DPrev { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Get the previous destination edge.
Data
Gets or sets the external data value for this edge.
Declaration
public object Data { get; set; }
Property Value
Type | Description |
---|---|
object |
Remarks
an object containing external data
Dest
Gets or sets the vertex for the edge's destination
Declaration
public Vertex Dest { get; }
Property Value
Type | Description |
---|---|
Vertex |
Remarks
Gets the destination vertex
InvRot
Gets the dual of this edge, directed from its left to its right.
Declaration
public QuadEdge InvRot { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the inverse rotated edge.
IsLive
Tests whether this edge has been deleted.
Declaration
public bool IsLive { get; }
Property Value
Type | Description |
---|---|
bool | true if this edge has not been deleted. |
LNext
Gets the CCW edge around the left face following this edge.
Declaration
public QuadEdge LNext { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the next left face edge.
LPrev
Gets the CCW edge around the left face before this edge.
Declaration
public QuadEdge LPrev { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Get the previous left face edge.
Length
Gets the length of the geometry of this quadedge.
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
Gets the length of the quadedge
ONext
Gets the next CCW edge around the origin of this edge.
Declaration
public QuadEdge ONext { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the next linked edge.
OPrev
Gets the next CW edge around (from) the origin of this edge.
Declaration
public QuadEdge OPrev { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the previous edge.
Orig
Gets or sets the vertex for the edge's origin
Declaration
public Vertex Orig { get; }
Property Value
Type | Description |
---|---|
Vertex |
Remarks
Gets the origin vertex
RNext
Gets the edge around the right face ccw following this edge.
Declaration
public QuadEdge RNext { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the next right face edge.
RPrev
Gets the edge around the right face ccw before this edge.
Declaration
public QuadEdge RPrev { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the previous right face edge.
Rot
Gets the dual of this edge, directed from its right to its left.
Declaration
public QuadEdge Rot { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets or Sets the rotated edge
Sym
Gets the edge from the destination to the origin of this edge.
Declaration
public QuadEdge Sym { get; }
Property Value
Type | Description |
---|---|
QuadEdge |
Remarks
Gets the sym of the edge.
Methods
| Edit this page View SourceConnect(QuadEdge, QuadEdge)
Creates a new QuadEdge connecting the destination of a to the origin of b, in such a way that all three have the same left face after the connection is complete. Additionally, the data pointers of the new edge are set.
Declaration
public static QuadEdge Connect(QuadEdge a, QuadEdge b)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | a | |
QuadEdge | b |
Returns
Type | Description |
---|---|
QuadEdge | the connected edge |
Delete()
Marks this quadedge as being deleted. This does not free the memory used by this quadedge quartet, but indicates that this edge no longer participates in a subdivision.
Declaration
public void Delete()
EqualsNonOriented(QuadEdge)
Tests if this quadedge and another have the same line segment geometry, regardless of orientation.
Declaration
public bool EqualsNonOriented(QuadEdge qe)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | qe | a quadedge |
Returns
Type | Description |
---|---|
bool | true if the quadedges are based on the same line segment regardless of orientation |
EqualsOriented(QuadEdge)
Tests if this quadedge and another have the same line segment geometry with the same orientation.
Declaration
public bool EqualsOriented(QuadEdge qe)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | qe | a quadedge |
Returns
Type | Description |
---|---|
bool | true if the quadedges are based on the same line segment |
GetPrimary()
Gets the primary edge of this quadedge and its sym. The primary edge is the one for which the origin and destination coordinates are ordered according to the standard Coordinate ordering
Declaration
public QuadEdge GetPrimary()
Returns
Type | Description |
---|---|
QuadEdge | the primary quadedge |
MakeEdge(Vertex, Vertex)
Declaration
public static QuadEdge MakeEdge(Vertex o, Vertex d)
Parameters
Type | Name | Description |
---|---|---|
Vertex | o | the origin Vertex |
Vertex | d | the destination Vertex |
Returns
Type | Description |
---|---|
QuadEdge | the new QuadEdge quartet |
SetNext(QuadEdge)
Sets the connected edge
Declaration
public void SetNext(QuadEdge next)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | next | edge |
Splice(QuadEdge, QuadEdge)
Splices two edges together or apart. Splice affects the two edge rings around the origins of a and b, and, independently, the two edge rings around the left faces of a and b. In each case, (i) if the two rings are distinct, Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it into two separate pieces. Thus, Splice can be used both to attach the two edges together, and to break them apart.
Declaration
public static void Splice(QuadEdge a, QuadEdge b)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | a | an edge to splice |
QuadEdge | b | an edge to splice |
Swap(QuadEdge)
Turns an edge counterclockwise inside its enclosing quadrilateral.
Declaration
public static void Swap(QuadEdge e)
Parameters
Type | Name | Description |
---|---|---|
QuadEdge | e | the quadedge to turn |
ToLineSegment()
Creates a LineSegment representing the geometry of this edge.
Declaration
public LineSegment ToLineSegment()
Returns
Type | Description |
---|---|
LineSegment | a LineSegment |
ToString()
Converts this edge to a WKT two-point LINESTRING indicating the geometry of this edge.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | a String representing this edge's geometry |