public class EdgeEnd extends Object implements Comparable
Constructor and Description |
---|
EdgeEnd(Edge edge,
Coordinate p0,
Coordinate p1) |
EdgeEnd(Edge edge,
Coordinate p0,
Coordinate p1,
Label label) |
Modifier and Type | Method and Description |
---|---|
int |
compareDirection(EdgeEnd e)
Implements the total order relation:
|
int |
compareTo(Object obj) |
void |
computeLabel(BoundaryNodeRule boundaryNodeRule) |
Coordinate |
getCoordinate() |
Coordinate |
getDirectedCoordinate() |
double |
getDx() |
double |
getDy() |
Edge |
getEdge() |
Label |
getLabel() |
Node |
getNode() |
int |
getQuadrant() |
void |
print(PrintStream out) |
void |
setNode(Node node) |
String |
toString() |
public EdgeEnd(Edge edge, Coordinate p0, Coordinate p1)
public EdgeEnd(Edge edge, Coordinate p0, Coordinate p1, Label label)
public Edge getEdge()
public Label getLabel()
public Coordinate getCoordinate()
public Coordinate getDirectedCoordinate()
public int getQuadrant()
public double getDx()
public double getDy()
public void setNode(Node node)
public Node getNode()
public int compareTo(Object obj)
compareTo
in interface Comparable
public int compareDirection(EdgeEnd e)
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.
e
- EdgeEndpublic void computeLabel(BoundaryNodeRule boundaryNodeRule)
public void print(PrintStream out)
Copyright © 2024. All rights reserved.