GEOS 3.6.2
geos::planargraph::Node Class Reference

A node in a PlanarGraph is a location where 0 or more Edge meet. More...

#include <Node.h>

Inheritance diagram for geos::planargraph::Node:
geos::planargraph::GraphComponent

Public Member Functions

 Node (const geom::Coordinate &newPt)
 Constructs a Node with the given location.
 Node (geom::Coordinate &newPt, DirectedEdgeStar *newDeStar)
 Constructs a Node with the given location and collection of outgoing DirectedEdges. Takes ownership of the given DirectedEdgeStar!!
geom::Coordinate & getCoordinate ()
 Returns the location of this Node.
void addOutEdge (DirectedEdge *de)
 Adds an outgoing DirectedEdge to this Node.
DirectedEdgeStar * getOutEdges ()
 Returns the collection of DirectedEdges that leave this Node.
const DirectedEdgeStar * getOutEdges () const
size_t getDegree () const
 Returns the number of edges around this Node.
int getIndex (Edge *edge)
 Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis.
Public Member Functions inherited from geos::planargraph::GraphComponent
virtual bool isVisited () const
 Tests if a component has been visited during the course of a graph algorithm.
virtual void setVisited (bool isVisited)
 Sets the visited flag for this component.
virtual bool isMarked () const
 Tests if a component has been marked at some point during the processing involving this graph.
virtual void setMarked (bool isMarked)
 Sets the marked flag for this component.

Static Public Member Functions

static std::vector< Edge * > * getEdgesBetween (Node *node0, Node *node1)
 Returns all Edges that connect the two nodes (which are assumed to be different).
Static Public Member Functions inherited from geos::planargraph::GraphComponent
template<typename T>
static void setVisited (T start, T end, bool visited)
 Sets the Visited state for the elements of a container, from start to end iterator.
template<typename T>
static void setVisitedMap (T start, T end, bool visited)
 Sets the Visited state for the values of each map container element, from start to end iterator.
template<typename T>
static void setMarked (T start, T end, bool marked)
 Sets the Marked state for the elements of a container, from start to end iterator.
template<typename T>
static void setMarkedMap (T start, T end, bool marked)
 Sets the Marked state for the values of each map container element, from start to end iterator.

Protected Attributes

geom::Coordinate pt
 The location of this Node.
DirectedEdgeStar * deStar
 The collection of DirectedEdges that leave this Node.
Protected Attributes inherited from geos::planargraph::GraphComponent
bool isMarkedVar
 Variable holding ''marked'' status.
bool isVisitedVar
 Variable holding ''visited'' status.

Friends

std::ostream & operator<< (std::ostream &os, const Node &n)
 Print a Node.

Detailed Description

A node in a PlanarGraph is a location where 0 or more Edge meet.

A node is connected to each of its incident Edges via an outgoing DirectedEdge. Some clients using a PlanarGraph may want to subclass Node to add their own application-specific data and methods.

Constructor & Destructor Documentation

◆ Node() [1/2]

geos::planargraph::Node::Node ( const geom::Coordinate & newPt)
inline

Constructs a Node with the given location.

References deStar, and pt.

Referenced by getEdgesBetween(), and operator<<.

◆ Node() [2/2]

geos::planargraph::Node::Node ( geom::Coordinate & newPt,
DirectedEdgeStar * newDeStar )
inline

Constructs a Node with the given location and collection of outgoing DirectedEdges. Takes ownership of the given DirectedEdgeStar!!

References deStar, and pt.

Member Function Documentation

◆ addOutEdge()

void geos::planargraph::Node::addOutEdge ( DirectedEdge * de)
inline

Adds an outgoing DirectedEdge to this Node.

References geos::planargraph::DirectedEdgeStar::add(), and deStar.

◆ getCoordinate()

geom::Coordinate & geos::planargraph::Node::getCoordinate ( )
inline

Returns the location of this Node.

References pt.

◆ getDegree()

size_t geos::planargraph::Node::getDegree ( ) const
inline

Returns the number of edges around this Node.

References deStar, and geos::planargraph::DirectedEdgeStar::getDegree().

◆ getEdgesBetween()

std::vector< Edge * > * geos::planargraph::Node::getEdgesBetween ( Node * node0,
Node * node1 )
static

Returns all Edges that connect the two nodes (which are assumed to be different).

Note: returned vector is newly allocated, ownership to the caller.

References Node().

◆ getIndex()

int geos::planargraph::Node::getIndex ( Edge * edge)
inline

Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis.

References deStar, and geos::planargraph::DirectedEdgeStar::getIndex().

◆ getOutEdges()

DirectedEdgeStar * geos::planargraph::Node::getOutEdges ( )
inline

Returns the collection of DirectedEdges that leave this Node.

References deStar.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Node & n )
friend

Print a Node.

References Node().

Member Data Documentation

◆ deStar

DirectedEdgeStar* geos::planargraph::Node::deStar
protected

The collection of DirectedEdges that leave this Node.

Referenced by addOutEdge(), getDegree(), getIndex(), getOutEdges(), Node(), and Node().

◆ pt

geom::Coordinate geos::planargraph::Node::pt
protected

The location of this Node.

Referenced by getCoordinate(), Node(), and Node().


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