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 private:
00047 PlanarGraph& graph;
00048
00050 Subgraph* findSubgraph(Node* node);
00051
00052
00059 void addReachable(Node* node, Subgraph* subgraph);
00060
00066 void addEdges(Node* node, std::stack<Node *>& nodeStack,
00067 Subgraph* subgraph);
00068
00069 public:
00070
00071 ConnectedSubgraphFinder(PlanarGraph& newGraph)
00072 :
00073 graph(newGraph)
00074 {}
00075
00084 void getConnectedSubgraphs(std::vector<Subgraph *>& dest);
00085
00086 };
00087
00088 }
00089 }
00090 }
00091
00092 #endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
00093