00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
00018 #define GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
00019
00020 #include <geos/export.h>
00021 #include <geos/planargraph/PlanarGraph.h>
00022
00023 #include <stack>
00024 #include <vector>
00025
00026
00027 namespace geos {
00028 namespace planargraph {
00029 class PlanarGraph;
00030 class Subgraph;
00031 class Node;
00032 }
00033 }
00034
00035 namespace geos {
00036 namespace planargraph {
00037 namespace algorithm {
00038
00044 class GEOS_DLL ConnectedSubgraphFinder
00045 {
00046 public:
00047
00048 ConnectedSubgraphFinder(PlanarGraph& newGraph)
00049 :
00050 graph(newGraph)
00051 {}
00052
00061 void getConnectedSubgraphs(std::vector<Subgraph *>& dest);
00062
00063 private:
00064
00065 PlanarGraph& graph;
00066
00068 Subgraph* findSubgraph(Node* node);
00069
00070
00077 void addReachable(Node* node, Subgraph* subgraph);
00078
00084 void addEdges(Node* node, std::stack<Node *>& nodeStack,
00085 Subgraph* subgraph);
00086
00087
00088 ConnectedSubgraphFinder(const ConnectedSubgraphFinder& other);
00089 ConnectedSubgraphFinder& operator=(const ConnectedSubgraphFinder& rhs);
00090 };
00091
00092 }
00093 }
00094 }
00095
00096 #endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
00097