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

A subgraph of a PlanarGraph. More...

#include <Subgraph.h>

Collaboration diagram for geos::planargraph::Subgraph:
[legend]

Public Member Functions

 Subgraph (PlanarGraph &parent)
 Creates a new subgraph of the given PlanarGraph. More...
 
PlanarGraphgetParent () const
 Gets the PlanarGraph which this subgraph is part of. More...
 
std::pair< std::set< Edge * >::iterator, bool > add (Edge *e)
 Adds an Edge to the subgraph. More...
 
std::vector< const DirectedEdge * >::iterator getDirEdgeBegin ()
 Returns an iterator over the DirectedEdge in this graph, in the order in which they were added. More...
 
std::set< Edge * >::iterator edgeBegin ()
 Returns an iterator over the Edges in this graph, in the order in which they were added. More...
 
std::set< Edge * >::iterator edgeEnd ()
 
NodeMap::container::iterator nodeBegin ()
 Returns a iterators over the planar NodeMap::container in this graph. More...
 
NodeMap::container::const_iterator nodeEnd () const
 
NodeMap::container::iterator nodeEnd ()
 
NodeMap::container::const_iterator nodeBegin () const
 
bool contains (Edge *e)
 Tests whether an Edge is contained in this subgraph. More...
 

Protected Member Functions

 Subgraph (const Subgraph &other)=delete
 
Subgraphoperator= (const Subgraph &rhs)=delete
 

Protected Attributes

PlanarGraphparentGraph
 
std::set< Edge * > edges
 
std::vector< const DirectedEdge * > dirEdges
 
NodeMap nodeMap
 

Detailed Description

A subgraph of a PlanarGraph.

A subgraph may contain any subset of Edges from the parent graph. It will also automatically contain all DirectedEdges and Nodes associated with those edges. No new objects are created when edges are added - all associated components must already exist in the parent graph.

Note
Actually we'll be copying Coordinates in NodeMap. I guess that'll need to be changed soon.

Definition at line 53 of file Subgraph.h.

Constructor & Destructor Documentation

geos::planargraph::Subgraph::Subgraph ( PlanarGraph parent)
inline

Creates a new subgraph of the given PlanarGraph.

Parameters
parentthe parent graph

Definition at line 60 of file Subgraph.h.

geos::planargraph::Subgraph::Subgraph ( const Subgraph other)
protecteddelete

Member Function Documentation

std::pair<std::set<Edge*>::iterator, bool> geos::planargraph::Subgraph::add ( Edge e)

Adds an Edge to the subgraph.

The associated DirectedEdges and Nodes are also added.

Parameters
ethe edge to add
Returns
a pair with first element being an iterator to the Edge in set and second element being a boolean value indicating wheter the Edge has been inserted now or was already in the set.
bool geos::planargraph::Subgraph::contains ( Edge e)
inline

Tests whether an Edge is contained in this subgraph.

Parameters
ethe edge to test
Returns
true if the edge is contained in this subgraph

Definition at line 159 of file Subgraph.h.

std::set<Edge*>::iterator geos::planargraph::Subgraph::edgeBegin ( )
inline

Returns an iterator over the Edges in this graph, in the order in which they were added.

Returns
an iterator over the edges
See also
add(Edge)

Definition at line 117 of file Subgraph.h.

std::set<Edge*>::iterator geos::planargraph::Subgraph::edgeEnd ( )
inline

Definition at line 122 of file Subgraph.h.

std::vector<const DirectedEdge*>::iterator geos::planargraph::Subgraph::getDirEdgeBegin ( )
inline

Returns an iterator over the DirectedEdge in this graph, in the order in which they were added.

Returns
an iterator over the directed edges
See also
add(Edge)

Definition at line 102 of file Subgraph.h.

PlanarGraph& geos::planargraph::Subgraph::getParent ( ) const
inline

Gets the PlanarGraph which this subgraph is part of.

Returns
the parent PlanarGraph

Definition at line 72 of file Subgraph.h.

NodeMap::container::iterator geos::planargraph::Subgraph::nodeBegin ( )
inline

Returns a iterators over the planar NodeMap::container in this graph.

Definition at line 132 of file Subgraph.h.

NodeMap::container::const_iterator geos::planargraph::Subgraph::nodeBegin ( ) const
inline

Definition at line 147 of file Subgraph.h.

NodeMap::container::const_iterator geos::planargraph::Subgraph::nodeEnd ( ) const
inline

Definition at line 137 of file Subgraph.h.

NodeMap::container::iterator geos::planargraph::Subgraph::nodeEnd ( )
inline

Definition at line 142 of file Subgraph.h.

Subgraph& geos::planargraph::Subgraph::operator= ( const Subgraph rhs)
protecteddelete

Member Data Documentation

std::vector<const DirectedEdge*> geos::planargraph::Subgraph::dirEdges
protected

Definition at line 168 of file Subgraph.h.

std::set<Edge*> geos::planargraph::Subgraph::edges
protected

Definition at line 167 of file Subgraph.h.

NodeMap geos::planargraph::Subgraph::nodeMap
protected

Definition at line 169 of file Subgraph.h.

PlanarGraph& geos::planargraph::Subgraph::parentGraph
protected

Definition at line 166 of file Subgraph.h.


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