GEOS 3.6.2
ConnectedSubgraphFinder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#ifndef GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
17#define GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
18
19#include <geos/export.h>
20#include <geos/planargraph/PlanarGraph.h> // for inlines
21
22#include <stack>
23#include <vector>
24
25// Forward declarations
26namespace geos {
27 namespace planargraph {
28 class PlanarGraph;
29 class Subgraph;
30 class Node;
31 }
32}
33
34namespace geos {
35namespace planargraph { // geos::planargraph
36namespace algorithm { // geos::planargraph::algorithm
37
43class GEOS_DLL ConnectedSubgraphFinder
44{
45public:
46
47 ConnectedSubgraphFinder(PlanarGraph& newGraph)
48 :
49 graph(newGraph)
50 {}
51
60 void getConnectedSubgraphs(std::vector<Subgraph *>& dest);
61
62private:
63
64 PlanarGraph& graph;
65
67 Subgraph* findSubgraph(Node* node);
68
69
76 void addReachable(Node* node, Subgraph* subgraph);
77
83 void addEdges(Node* node, std::stack<Node *>& nodeStack,
84 Subgraph* subgraph);
85
86 // Declare type as noncopyable
87 ConnectedSubgraphFinder(const ConnectedSubgraphFinder& other);
88 ConnectedSubgraphFinder& operator=(const ConnectedSubgraphFinder& rhs);
89};
90
91} // namespace geos::planargraph::algorithm
92} // namespace geos::planargraph
93} // namespace geos
94
95#endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
96
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition planargraph/Node.h:45
Represents a directed graph which is embeddable in a planar surface.
Definition planargraph/PlanarGraph.h:60
A subgraph of a PlanarGraph.
Definition Subgraph.h:54
void getConnectedSubgraphs(std::vector< Subgraph * > &dest)
Store newly allocated connected Subgraphs into the given std::vector.
Planargraph algorithms.
Definition planargraph.h:25
Contains classes to implement a planar graph data structure.
Definition LineMergeDirectedEdge.h:32
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25