GEOS 3.14.0dev
|
Models the end of an edge incident on a node. More...
#include <EdgeEnd.h>
Public Member Functions | |
EdgeEnd (Edge *newEdge, const geom::Coordinate &newP0, const geom::Coordinate &newP1, const Label &newLabel) | |
EdgeEnd (Edge *newEdge, const geom::Coordinate &newP0, const geom::Coordinate &newP1) | |
Edge * | getEdge () |
Label & | getLabel () |
const Label & | getLabel () const |
geom::Coordinate & | getCoordinate () |
const geom::Coordinate & | getCoordinate () const |
geom::Coordinate & | getDirectedCoordinate () |
int | getQuadrant () |
double | getDx () |
double | getDy () |
void | setNode (Node *newNode) |
Node * | getNode () |
int | compareTo (const EdgeEnd *e) const |
int | compareDirection (const EdgeEnd *e) const |
virtual void | computeLabel (const algorithm::BoundaryNodeRule &bnr) |
virtual std::string | print () const |
Protected Member Functions | |
EdgeEnd (Edge *newEdge) | |
void | init (const geom::Coordinate &newP0, const geom::Coordinate &newP1) |
Protected Attributes | |
Edge * | edge |
Label | label |
Friends | |
std::ostream & | operator<< (std::ostream &, const EdgeEnd &) |
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.
geos::geomgraph::EdgeEnd::EdgeEnd | ( | Edge * | newEdge, |
const geom::Coordinate & | newP0, | ||
const geom::Coordinate & | newP1, | ||
const Label & | newLabel | ||
) |
geos::geomgraph::EdgeEnd::EdgeEnd | ( | Edge * | newEdge, |
const geom::Coordinate & | newP0, | ||
const geom::Coordinate & | newP1 | ||
) |
int geos::geomgraph::EdgeEnd::compareDirection | ( | const EdgeEnd * | e | ) | const |
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: