GEOS 3.9.1
ConnectedSubgraphFinder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#ifndef GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
17#define GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
18
19#include <geos/export.h>
20#include <geos/planargraph/PlanarGraph.h> // for inlines
21
22#include <stack>
23#include <vector>
24
25// Forward declarations
26namespace geos {
27namespace planargraph {
28class PlanarGraph;
29class Subgraph;
30class Node;
31}
32}
33
34namespace geos {
35namespace planargraph { // geos::planargraph
36namespace algorithm { // geos::planargraph::algorithm
37
44public:
45
47 :
48 graph(newGraph)
49 {}
50
59 void getConnectedSubgraphs(std::vector<Subgraph*>& dest);
60
61private:
62
63 PlanarGraph& graph;
64
66 Subgraph* findSubgraph(Node* node);
67
68
75 void addReachable(Node* node, Subgraph* subgraph);
76
82 void addEdges(Node* node, std::stack<Node*>& nodeStack,
83 Subgraph* subgraph);
84
85 // Declare type as noncopyable
87 ConnectedSubgraphFinder& operator=(const ConnectedSubgraphFinder& rhs) = delete;
88};
89
90} // namespace geos::planargraph::algorithm
91} // namespace geos::planargraph
92} // namespace geos
93
94#endif // GEOS_PLANARGRAPH_ALGO_CONNECTEDSUBGRAPHFINDER_H
95
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition planargraph/Node.h:45
Represents a directed graph which is embeddable in a planar surface.
Definition planargraph/PlanarGraph.h:60
A subgraph of a PlanarGraph.
Definition Subgraph.h:53
Finds all connected Subgraphs of a PlanarGraph.
Definition ConnectedSubgraphFinder.h:43
void getConnectedSubgraphs(std::vector< Subgraph * > &dest)
Store newly allocated connected Subgraphs into the given std::vector.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26