GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
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:
[legend]
Collaboration diagram for geos::planargraph::Node:
[legend]

Public Member Functions

 Node (const geom::Coordinate &newPt)
 Constructs a Node with the given location. More...
 
 ~Node () override
 
 Node (geom::Coordinate &newPt, DirectedEdgeStar *newDeStar)
 Constructs a Node with the given location and collection of outgoing DirectedEdges. Takes ownership of the given DirectedEdgeStar!! More...
 
geom::CoordinategetCoordinate ()
 Returns the location of this Node. More...
 
void addOutEdge (DirectedEdge *de)
 Adds an outgoing DirectedEdge to this Node. More...
 
DirectedEdgeStargetOutEdges ()
 Returns the collection of DirectedEdges that leave this Node. More...
 
const DirectedEdgeStargetOutEdges () const
 
size_t getDegree () const
 Returns the number of edges around this Node. More...
 
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. More...
 
- Public Member Functions inherited from geos::planargraph::GraphComponent
 GraphComponent ()
 
virtual ~GraphComponent ()
 
virtual bool isVisited () const
 Tests if a component has been visited during the course of a graph algorithm. More...
 
virtual void setVisited (bool p_isVisited)
 Sets the visited flag for this component. More...
 
virtual bool isMarked () const
 Tests if a component has been marked at some point during the processing involving this graph. More...
 
virtual void setMarked (bool p_isMarked)
 Sets the marked flag for this component. More...
 

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). More...
 
- 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. More...
 
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. More...
 
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. More...
 
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. More...
 

Protected Attributes

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

Private Member Functions

 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 

Friends

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

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.

Definition at line 45 of file planargraph/Node.h.

Constructor & Destructor Documentation

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

Constructs a Node with the given location.

Definition at line 69 of file planargraph/Node.h.

geos::planargraph::Node::~Node ( )
inlineoverride

Definition at line 76 of file planargraph/Node.h.

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!!

Definition at line 87 of file planargraph/Node.h.

geos::planargraph::Node::Node ( const Node )
privatedelete

Member Function Documentation

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

Adds an outgoing DirectedEdge to this Node.

Definition at line 106 of file planargraph/Node.h.

References geos::planargraph::DirectedEdgeStar::add().

Here is the call graph for this function:

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

Returns the location of this Node.

Definition at line 97 of file planargraph/Node.h.

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

Returns the number of edges around this Node.

Definition at line 130 of file planargraph/Node.h.

References geos::planargraph::DirectedEdgeStar::getDegree().

Here is the call graph for this function:

static 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.

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.

Definition at line 141 of file planargraph/Node.h.

References geos::planargraph::DirectedEdgeStar::getIndex(), and geos::planargraph::operator<<().

Here is the call graph for this function:

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

Returns the collection of DirectedEdges that leave this Node.

Definition at line 116 of file planargraph/Node.h.

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

Definition at line 121 of file planargraph/Node.h.

Node& geos::planargraph::Node::operator= ( const Node )
privatedelete

Friends And Related Function Documentation

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

Print a Node.

Member Data Documentation

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

The collection of DirectedEdges that leave this Node.

Definition at line 52 of file planargraph/Node.h.

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

The location of this Node.

Definition at line 49 of file planargraph/Node.h.


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