GEOS  3.9.1dev
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
geos::planargraph::Edge Class Reference

Represents an undirected edge of a PlanarGraph. More...

#include <Edge.h>

Inheritance diagram for geos::planargraph::Edge:
[legend]
Collaboration diagram for geos::planargraph::Edge:
[legend]

Public Types

typedef std::set< const Edge * > ConstSet
 Set of const Edges pointers. More...
 
typedef std::set< Edge * > NonConstSet
 Set of non-const Edges pointers. More...
 
typedef std::vector< Edge * > NonConstVect
 Vector of non-const Edges pointers. More...
 
typedef std::vector< const Edge * > ConstVect
 Vector of const Edges pointers. More...
 

Public Member Functions

 Edge ()
 Constructs a Edge whose DirectedEdges are not yet set. More...
 
 Edge (DirectedEdge *de0, DirectedEdge *de1)
 Constructs an Edge initialized with the given DirectedEdges. More...
 
void setDirectedEdges (DirectedEdge *de0, DirectedEdge *de1)
 Initializes this Edge's two DirectedEdges. More...
 
DirectedEdgegetDirEdge (int i)
 Returns one of the DirectedEdges associated with this Edge. More...
 
DirectedEdgegetDirEdge (Node *fromNode)
 Returns the DirectedEdge that starts from the given node, or null if the node is not one of the two nodes associated with this Edge. More...
 
NodegetOppositeNode (Node *node)
 If node is one of the two nodes associated with this Edge, returns the other node; otherwise returns null. 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...
 

Protected Attributes

std::vector< DirectedEdge * > dirEdge
 The two DirectedEdges associated with this Edge. More...
 
- Protected Attributes inherited from geos::planargraph::GraphComponent
bool isMarkedVar
 Variable holding ''marked'' status. More...
 
bool isVisitedVar
 Variable holding ''visited'' status. More...
 

Friends

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

Additional Inherited Members

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

Detailed Description

Represents an undirected edge of a PlanarGraph.

An undirected edge in fact simply acts as a central point of reference for two opposite DirectedEdge.

Usually a client using a PlanarGraph will subclass Edge to add its own application-specific data and methods.

Definition at line 54 of file planargraph/Edge.h.

Member Typedef Documentation

typedef std::set<const Edge*> geos::planargraph::Edge::ConstSet

Set of const Edges pointers.

Definition at line 61 of file planargraph/Edge.h.

typedef std::vector<const Edge*> geos::planargraph::Edge::ConstVect

Vector of const Edges pointers.

Definition at line 70 of file planargraph/Edge.h.

Set of non-const Edges pointers.

Definition at line 64 of file planargraph/Edge.h.

Vector of non-const Edges pointers.

Definition at line 67 of file planargraph/Edge.h.

Constructor & Destructor Documentation

geos::planargraph::Edge::Edge ( )
inline

Constructs a Edge whose DirectedEdges are not yet set.

Be sure to call setDirectedEdges(DirectedEdge* de0, DirectedEdge* de1)

Definition at line 85 of file planargraph/Edge.h.

geos::planargraph::Edge::Edge ( DirectedEdge de0,
DirectedEdge de1 
)
inline

Constructs an Edge initialized with the given DirectedEdges.

For each DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node.

Definition at line 93 of file planargraph/Edge.h.

References geos::planargraph::operator<<().

Here is the call graph for this function:

Member Function Documentation

DirectedEdge* geos::planargraph::Edge::getDirEdge ( int  i)

Returns one of the DirectedEdges associated with this Edge.

Parameters
i0 or 1
DirectedEdge* geos::planargraph::Edge::getDirEdge ( Node fromNode)

Returns the DirectedEdge that starts from the given node, or null if the node is not one of the two nodes associated with this Edge.

Node* geos::planargraph::Edge::getOppositeNode ( Node node)

If node is one of the two nodes associated with this Edge, returns the other node; otherwise returns null.

void geos::planargraph::Edge::setDirectedEdges ( DirectedEdge de0,
DirectedEdge de1 
)

Initializes this Edge's two DirectedEdges.

For each DirectedEdge:

Friends And Related Function Documentation

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

Print a Node.

Member Data Documentation

std::vector<DirectedEdge*> geos::planargraph::Edge::dirEdge
protected

The two DirectedEdges associated with this Edge.

Definition at line 75 of file planargraph/Edge.h.


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