com.vividsolutions.jts.geomgraph
Class EdgeEnd
java.lang.Object
com.vividsolutions.jts.geomgraph.EdgeEnd
- Comparable
public class EdgeEnd
extends java.lang.Object
implements Comparable
Models the end of an edge incident on a node.
EdgeEnds have a direction
determined by the direction of the ray from the initial
point to the next point.
EdgeEnds are comparable under the ordering
"a has a greater angle with the x-axis than b".
This ordering is used to sort EdgeEnds around a node.
label
protected Label label
EdgeEnd
protected EdgeEnd(Edge edge)
compareDirection
public int compareDirection(EdgeEnd e)
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 roundoff.
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.
compareTo
public int compareTo(Object obj)
computeLabel
public void computeLabel()
getDirectedCoordinate
public Coordinate getDirectedCoordinate()
getDx
public double getDx()
getDy
public double getDy()
getEdge
public Edge getEdge()
getLabel
public Label getLabel()
getNode
public Node getNode()
getQuadrant
public int getQuadrant()
print
public void print(PrintStream out)
setNode
public void setNode(Node node)