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