GEOS 3.11.1
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
geos::geomgraph::EdgeEnd Class Reference

Models the end of an edge incident on a node. More...

#include <EdgeEnd.h>

Inheritance diagram for geos::geomgraph::EdgeEnd:
geos::geomgraph::DirectedEdge geos::operation::relate::EdgeEndBundle

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)
 
EdgegetEdge ()
 
LabelgetLabel ()
 
const LabelgetLabel () const
 
virtual geom::CoordinategetCoordinate ()
 
const geom::CoordinategetCoordinate () const
 
virtual geom::CoordinategetDirectedCoordinate ()
 
virtual int getQuadrant ()
 
virtual double getDx ()
 
virtual double getDy ()
 
virtual void setNode (Node *newNode)
 
virtual NodegetNode ()
 
virtual int compareTo (const EdgeEnd *e) const
 
virtual int compareDirection (const EdgeEnd *e) const
 
virtual void computeLabel (const algorithm::BoundaryNodeRule &bnr)
 
virtual std::string print () const
 

Protected Member Functions

 EdgeEnd (Edge *newEdge)
 
virtual void init (const geom::Coordinate &newP0, const geom::Coordinate &newP1)
 

Protected Attributes

Edgeedge
 
Label label
 

Friends

std::ostream & operator<< (std::ostream &, const EdgeEnd &)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EdgeEnd() [1/2]

geos::geomgraph::EdgeEnd::EdgeEnd ( Edge newEdge,
const geom::Coordinate newP0,
const geom::Coordinate newP1,
const Label newLabel 
)

NOTES:

  • Copies the given Label
  • keeps a pointer to given Edge, make sure it's not deleted before the EdgeEnd.
  • copies given Coordinates (maybe we should avoid that)

◆ EdgeEnd() [2/2]

geos::geomgraph::EdgeEnd::EdgeEnd ( Edge newEdge,
const geom::Coordinate newP0,
const geom::Coordinate newP1 
)

NOTES:

  • keeps a pointer to given Edge, make sure it's not deleted before the EdgeEnd.
  • copies given Coordinates (maybe we should avoid that)

Member Function Documentation

◆ compareDirection()

virtual int geos::geomgraph::EdgeEnd::compareDirection ( const EdgeEnd e) const
virtual

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.

The documentation for this class was generated from the following file: