GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
geos::operation::buffer::BufferSubgraph Class Reference

A connected subset of the graph of DirectedEdge and geomgraph::Node. More...

#include <BufferSubgraph.h>

Collaboration diagram for geos::operation::buffer::BufferSubgraph:
[legend]

Public Member Functions

 BufferSubgraph ()
 
 ~BufferSubgraph ()
 
std::vector< geomgraph::DirectedEdge * > * getDirectedEdges ()
 
std::vector< geomgraph::Node * > * getNodes ()
 
geom::CoordinategetRightmostCoordinate ()
 Gets the rightmost coordinate in the edges of the subgraph. More...
 
void create (geomgraph::Node *node)
 Creates the subgraph consisting of all edges reachable from this node. More...
 
void computeDepth (int outsideDepth)
 
void findResultEdges ()
 Find all edges whose depths indicates that they are in the result area(s). More...
 
int compareTo (BufferSubgraph *)
 BufferSubgraphs are compared on the x-value of their rightmost Coordinate. More...
 
geom::EnvelopegetEnvelope ()
 Computes the envelope of the edges in the subgraph. The envelope is cached after being computed. More...
 

Private Member Functions

void addReachable (geomgraph::Node *startNode)
 Adds all nodes and edges reachable from this node to the subgraph. More...
 
void add (geomgraph::Node *node, std::vector< geomgraph::Node * > *nodeStack)
 
void clearVisitedEdges ()
 
void computeDepths (geomgraph::DirectedEdge *startEdge)
 Compute depths for all dirEdges via breadth-first traversal of nodes in graph. More...
 
void computeNodeDepth (geomgraph::Node *n)
 
void copySymDepths (geomgraph::DirectedEdge *de)
 
bool contains (std::set< geomgraph::Node * > &nodes, geomgraph::Node *node)
 

Private Attributes

RightmostEdgeFinder finder
 
std::vector< geomgraph::DirectedEdge * > dirEdgeList
 
std::vector< geomgraph::Node * > nodes
 
geom::CoordinaterightMostCoord
 
geom::Envelopeenv
 

Friends

std::ostream & operator<< (std::ostream &os, const BufferSubgraph &bs)
 

Detailed Description

A connected subset of the graph of DirectedEdge and geomgraph::Node.

Its edges will generate either

Definition at line 61 of file BufferSubgraph.h.

Constructor & Destructor Documentation

geos::operation::buffer::BufferSubgraph::BufferSubgraph ( )
geos::operation::buffer::BufferSubgraph::~BufferSubgraph ( )

Member Function Documentation

void geos::operation::buffer::BufferSubgraph::add ( geomgraph::Node node,
std::vector< geomgraph::Node * > *  nodeStack 
)
private

Adds the argument node and all its out edges to the subgraph

Parameters
nodethe node to add
nodeStackthe current set of nodes being traversed
void geos::operation::buffer::BufferSubgraph::addReachable ( geomgraph::Node startNode)
private

Adds all nodes and edges reachable from this node to the subgraph.

Uses an explicit stack to avoid a large depth of recursion.

Parameters
startNodea node known to be in the subgraph
void geos::operation::buffer::BufferSubgraph::clearVisitedEdges ( )
private
int geos::operation::buffer::BufferSubgraph::compareTo ( BufferSubgraph )

BufferSubgraphs are compared on the x-value of their rightmost Coordinate.

This defines a partial ordering on the graphs such that:

g1 >= g2 <==> Ring(g2) does not contain Ring(g1)

where Polygon(g) is the buffer polygon that is built from g.

This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to be built before holes.

void geos::operation::buffer::BufferSubgraph::computeDepth ( int  outsideDepth)
void geos::operation::buffer::BufferSubgraph::computeDepths ( geomgraph::DirectedEdge startEdge)
private

Compute depths for all dirEdges via breadth-first traversal of nodes in graph.

Parameters
startEdgeedge to start processing with
void geos::operation::buffer::BufferSubgraph::computeNodeDepth ( geomgraph::Node n)
private
bool geos::operation::buffer::BufferSubgraph::contains ( std::set< geomgraph::Node * > &  nodes,
geomgraph::Node node 
)
private
void geos::operation::buffer::BufferSubgraph::copySymDepths ( geomgraph::DirectedEdge de)
private
void geos::operation::buffer::BufferSubgraph::create ( geomgraph::Node node)

Creates the subgraph consisting of all edges reachable from this node.

Finds the edges in the graph and the rightmost coordinate.

Parameters
nodea node to start the graph traversal from
void geos::operation::buffer::BufferSubgraph::findResultEdges ( )

Find all edges whose depths indicates that they are in the result area(s).

Since we want polygon shells to be oriented CW, choose dirEdges with the interior of the result on the RHS. Mark them as being in the result. Interior Area edges are the result of dimensional collapses. They do not form part of the result area boundary.

std::vector< geomgraph::DirectedEdge * > * geos::operation::buffer::BufferSubgraph::getDirectedEdges ( )
inline

Definition at line 189 of file BufferSubgraph.h.

References geos::operation::buffer::BufferSubgraphGT().

Here is the call graph for this function:

geom::Envelope* geos::operation::buffer::BufferSubgraph::getEnvelope ( )

Computes the envelope of the edges in the subgraph. The envelope is cached after being computed.

Returns
the envelope of the graph.
std::vector< geomgraph::Node * > * geos::operation::buffer::BufferSubgraph::getNodes ( )
inline

Definition at line 183 of file BufferSubgraph.h.

geom::Coordinate * geos::operation::buffer::BufferSubgraph::getRightmostCoordinate ( )
inline

Gets the rightmost coordinate in the edges of the subgraph.

Definition at line 177 of file BufferSubgraph.h.

Friends And Related Function Documentation

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

Member Data Documentation

std::vector<geomgraph::DirectedEdge*> geos::operation::buffer::BufferSubgraph::dirEdgeList
private

Definition at line 65 of file BufferSubgraph.h.

geom::Envelope* geos::operation::buffer::BufferSubgraph::env
private

Definition at line 71 of file BufferSubgraph.h.

RightmostEdgeFinder geos::operation::buffer::BufferSubgraph::finder
private

Definition at line 63 of file BufferSubgraph.h.

std::vector<geomgraph::Node*> geos::operation::buffer::BufferSubgraph::nodes
private

Definition at line 67 of file BufferSubgraph.h.

geom::Coordinate* geos::operation::buffer::BufferSubgraph::rightMostCoord
private

Definition at line 69 of file BufferSubgraph.h.


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