Table of Contents

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 Edge
p0 Coordinate
p1 Coordinate

EdgeEnd(Edge, Coordinate, Coordinate, Label)

public EdgeEnd(Edge edge, Coordinate p0, Coordinate p1, Label label)

Parameters

edge Edge
p0 Coordinate
p1 Coordinate
label Label

Properties

Coordinate

public Coordinate Coordinate { get; }

Property Value

Coordinate

DirectedCoordinate

public Coordinate DirectedCoordinate { get; }

Property Value

Coordinate

Dx

public double Dx { get; }

Property Value

double

Dy

public double Dy { get; }

Property Value

double

Edge

public Edge Edge { get; protected set; }

Property Value

Edge

Label

public Label Label { get; protected set; }

Property Value

Label

Node

public Node Node { get; set; }

Property Value

Node

Quadrant

[Obsolete("Use QuadrantEx")]
public int Quadrant { get; }

Property Value

int

QuadrantEx

Gets a value indicating the Quadrant this EdgeEnd lies in.

public Quadrant QuadrantEx { get; }

Property Value

Quadrant

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 EdgeEnd

An EdgeEnd

Returns

int

The OrientationIndex of e compared to this EdgeEnd.

CompareTo(EdgeEnd)

public int CompareTo(EdgeEnd e)

Parameters

e EdgeEnd

Returns

int

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 Coordinate
p1 Coordinate

ToString()

public override string ToString()

Returns

string

Write(StreamWriter)

public virtual void Write(StreamWriter outstream)

Parameters

outstream StreamWriter