GEOS 3.6.2
geos::planargraph::Subgraph Class Reference

A subgraph of a PlanarGraph. More...

#include <Subgraph.h>

Public Member Functions

 Subgraph (PlanarGraph &parent)
PlanarGraphgetParent () const
std::pair< std::set< Edge * >::iterator, bool > add (Edge *e)
std::vector< constDirectedEdge * >::iterator getDirEdgeBegin ()
std::set< Edge * >::iterator edgeBegin ()
std::set< Edge * >::iterator edgeEnd ()
NodeMap::container::iterator nodeBegin ()
NodeMap::container::const_iterator nodeEnd () const
NodeMap::container::iterator nodeEnd ()
NodeMap::container::const_iterator nodeBegin () const
bool contains (Edge *e)

Protected Member Functions

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

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 geomgraph::Edges from the parent graph. It will also automatically contain all geomgraph::DirectedEdge and geomgraph::Node associated with those edges. No new objects are created when edges are added - all associated components must already exist in the parent graph.

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

Constructor & Destructor Documentation

◆ Subgraph()

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

Creates a new subgraph of the given PlanarGraph

Parameters
parentthe parent graph

Member Function Documentation

◆ add()

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

Adds an Edge to the subgraph. The associated DirectedEdges and planarNodes 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.

◆ contains()

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

◆ edgeBegin()

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)

◆ getDirEdgeBegin()

std::vector< constDirectedEdge * >::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)

◆ getParent()

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

Gets the PlanarGraph which this subgraph is part of.

Returns
the parent PlanarGraph

◆ nodeBegin()

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

Returns a iterators over the planarNodesMap::container in this graph.


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