ConnectedSubgraphFinder.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/planargraph/PlanarGraph.h> // for inlines
#include <stack>
#include <vector>
// Forward declarations
namespace geos {
namespace planargraph {
class PlanarGraph;
class Subgraph;
class Node;
}
}
namespace geos {
namespace planargraph { // geos::planargraph
namespace algorithm { // geos::planargraph::algorithm
class GEOS_DLL ConnectedSubgraphFinder {
public:
ConnectedSubgraphFinder(PlanarGraph& newGraph)
:
graph(newGraph)
{}
void getConnectedSubgraphs(std::vector<Subgraph*>& dest);
private:
PlanarGraph& graph;
Subgraph* findSubgraph(Node* node);
void addReachable(Node* node, Subgraph* subgraph);
void addEdges(Node* node, std::stack<Node*>& nodeStack,
Subgraph* subgraph);
// Declare type as noncopyable
ConnectedSubgraphFinder(const ConnectedSubgraphFinder& other) = delete;
ConnectedSubgraphFinder& operator=(const ConnectedSubgraphFinder& rhs) = delete;
};
} // namespace geos::planargraph::algorithm
} // namespace geos::planargraph
} // namespace geos
geos::planargraph::Node
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition planargraph/Node.h:44
geos::planargraph::PlanarGraph
Represents a directed graph which is embeddable in a planar surface.
Definition planargraph/PlanarGraph.h:59
geos::planargraph::Subgraph
A subgraph of a PlanarGraph.
Definition Subgraph.h:52
geos::planargraph::algorithm::ConnectedSubgraphFinder::getConnectedSubgraphs
void getConnectedSubgraphs(std::vector< Subgraph * > &dest)
Store newly allocated connected Subgraphs into the given std::vector.
geos::planargraph::algorithm
Planargraph algorithms.
Definition namespaces.h:296
geos::planargraph
Contains classes to implement a planar graph data structure.
Definition namespaces.h:293
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38