GEOS: ConnectedSubgraphFinder.h Source File

GEOS 3.3.8

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

ConnectedSubgraphFinder.h
1 /**********************************************************************
2 * $Id: ConnectedSubgraphFinder.h 2783 2009-12-03 19:51:16Z mloskot $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 * Copyright (C) 2005-2006 Refractions Research Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************/
16
17 #ifndef GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
18 #define GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
19
20 #include <geos/export.h>
21 #include <geos/planargraph/PlanarGraph.h> // for inlines
22
23 #include <stack>
24 #include <vector>
25
26 // Forward declarations
27 namespace geos {
28 namespace planargraph {
29 class PlanarGraph;
30 class Subgraph;
31 class Node;
32 }
33 }
34
35 namespace geos {
36 namespace planargraph { // geos::planargraph
37 namespace algorithm { // geos::planargraph::algorithm
38
44 class GEOS_DLL ConnectedSubgraphFinder
45 {
46 public:
47
48 ConnectedSubgraphFinder(PlanarGraph& newGraph)
49 :
50 graph(newGraph)
51 {}
52
61 void getConnectedSubgraphs(std::vector<Subgraph *>& dest);
62
63 private:
64
65 PlanarGraph& graph;
66
68 Subgraph* findSubgraph(Node* node);
69
70
77 void addReachable(Node* node, Subgraph* subgraph);
78
84 void addEdges(Node* node, std::stack<Node *>& nodeStack,
85 Subgraph* subgraph);
86
87 // Declare type as noncopyable
88 ConnectedSubgraphFinder(const ConnectedSubgraphFinder& other);
89 ConnectedSubgraphFinder& operator=(const ConnectedSubgraphFinder& rhs);
90 };
91
92 } // namespace geos::planargraph::algorithm
93 } // namespace geos::planargraph
94 } // namespace geos
95
96 #endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
97