Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

ConnectedSubgraphFinder.h

00001 /**********************************************************************
00002  * $Id: ConnectedSubgraphFinder.h 2556 2009-06-06 22:22:28Z strk $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  * Copyright (C) 2005-2006 Refractions Research Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
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> // for inlines
00022 
00023 #include <stack>
00024 #include <vector>
00025 
00026 // Forward declarations
00027 namespace geos {
00028         namespace planargraph { 
00029                 class PlanarGraph;
00030                 class Subgraph;
00031                 class Node;
00032         }
00033 }
00034 
00035 namespace geos {
00036 namespace planargraph { // geos::planargraph
00037 namespace algorithm { // geos::planargraph::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 } // namespace geos::planargraph::algorithm
00089 } // namespace geos::planargraph
00090 } // namespace geos
00091 
00092 #endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
00093 

Generated on Thu Jun 11 06:17:00 2009 for GEOS by  doxygen 1.4.4