public class EdgeEnd extends Object implements Comparable
| Modifier | Constructor and Description |
|---|---|
protected |
EdgeEnd(Edge edge) |
|
EdgeEnd(Edge edge,
Point p0,
Point p1) |
|
EdgeEnd(Edge edge,
Point p0,
Point 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) |
Point |
getCoordinate() |
Point |
getDirectedCoordinate() |
double |
getDx() |
double |
getDy() |
Edge |
getEdge() |
Label |
getLabel() |
Node |
getNode() |
int |
getQuadrant() |
protected void |
init(Point p0,
Point p1) |
void |
print(PrintStream out) |
protected void |
setLabel(Label label) |
void |
setNode(Node node) |
String |
toString() |
protected Edge edge
protected EdgeEnd(Edge edge)
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.
public int compareTo(Object obj)
compareTo in interface Comparablepublic void computeLabel(BoundaryNodeRule boundaryNodeRule)
public Point getCoordinate()
public Point getDirectedCoordinate()
public double getDx()
public double getDy()
public Edge getEdge()
public Label getLabel()
public Node getNode()
public int getQuadrant()
public void print(PrintStream out)
protected void setLabel(Label label)
public void setNode(Node node)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.