Class EdgeEnd
- Namespace
- NetTopologySuite.GeometriesGraph
- Assembly
- NetTopologySuite.dll
Models the end of an edge incident on a node.
public class EdgeEnd : IComparable<EdgeEnd>
- Inheritance
-
EdgeEnd
- Implements
- Derived
- Inherited Members
Remarks
EdgeEnds have a direction determined by the direction of the ray from the initial point to the next point.
EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". This ordering is used to sort EdgeEnds around a node.
Constructors
EdgeEnd(Edge)
protected EdgeEnd(Edge edge)
Parameters
edge
Edge
EdgeEnd(Edge, Coordinate, Coordinate)
public EdgeEnd(Edge edge, Coordinate p0, Coordinate p1)
Parameters
edge
Edgep0
Coordinatep1
Coordinate
EdgeEnd(Edge, Coordinate, Coordinate, Label)
public EdgeEnd(Edge edge, Coordinate p0, Coordinate p1, Label label)
Parameters
edge
Edgep0
Coordinatep1
Coordinatelabel
Label
Properties
Coordinate
public Coordinate Coordinate { get; }
Property Value
DirectedCoordinate
public Coordinate DirectedCoordinate { get; }
Property Value
Dx
public double Dx { get; }
Property Value
Dy
public double Dy { get; }
Property Value
Edge
public Edge Edge { get; protected set; }
Property Value
Label
public Label Label { get; protected set; }
Property Value
Node
public Node Node { get; set; }
Property Value
Quadrant
[Obsolete("Use QuadrantEx")]
public int Quadrant { get; }
Property Value
QuadrantEx
Gets a value indicating the Quadrant
this EdgeEnd
lies in.
public Quadrant QuadrantEx { get; }
Property Value
Methods
CompareDirection(EdgeEnd)
Implements the total order relation: a has a greater angle with the positive x-axis than b.
Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is obviously susceptible to round off. A robust algorithm is:- first compare the quadrant. If the quadrants are different, it it trivial to determine which vector is "greater".
- if the vectors lie in the same quadrant, the computeOrientation function can be used to decide the relative orientation of the vectors.
public int CompareDirection(EdgeEnd e)
Parameters
e
EdgeEndAn EdgeEnd
Returns
- int
The OrientationIndex of
e
compared tothis
EdgeEnd.
CompareTo(EdgeEnd)
public int CompareTo(EdgeEnd e)
Parameters
e
EdgeEnd
Returns
ComputeLabel(IBoundaryNodeRule)
Subclasses should override this if they are using labels
public virtual void ComputeLabel(IBoundaryNodeRule boundaryNodeRule)
Parameters
boundaryNodeRule
IBoundaryNodeRule
Init(Coordinate, Coordinate)
protected void Init(Coordinate p0, Coordinate p1)
Parameters
p0
Coordinatep1
Coordinate
ToString()
public override string ToString()
Returns
Write(StreamWriter)
public virtual void Write(StreamWriter outstream)
Parameters
outstream
StreamWriter