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