00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_PLANARGRAPH_SUBGRAPH_H
00018 #define GEOS_PLANARGRAPH_SUBGRAPH_H
00019
00020 #include <geos/planargraph/NodeMap.h>
00021
00022 #include <vector>
00023
00024
00025 namespace geos {
00026 namespace planargraph {
00027 class PlanarGraph;
00028 class DirectedEdge;
00029 class Edge;
00030 }
00031 }
00032
00033 namespace geos {
00034 namespace planargraph {
00035
00037
00048 class Subgraph
00049 {
00050 protected:
00051 PlanarGraph &parentGraph;
00052 std::set<Edge*> edges;
00053 std::vector<const DirectedEdge*> dirEdges;
00054 NodeMap nodeMap;
00055
00056 public:
00062 Subgraph(PlanarGraph &parent)
00063 :
00064 parentGraph(parent)
00065 {}
00066
00073 PlanarGraph& getParent() const { return parentGraph; }
00074
00088 std::pair<std::set<Edge*>::iterator, bool> add(Edge *e);
00089
00098 std::vector<const DirectedEdge*>::iterator getDirEdgeBegin() {
00099 return dirEdges.begin();
00100 }
00101
00102
00111 std::set<Edge*>::iterator edgeBegin() { return edges.begin(); }
00112 std::set<Edge*>::iterator edgeEnd() { return edges.end(); }
00113
00118 NodeMap::container::iterator nodeBegin() {
00119 return nodeMap.begin();
00120 }
00121 NodeMap::container::const_iterator nodeEnd() const {
00122 return nodeMap.end();
00123 }
00124 NodeMap::container::iterator nodeEnd() {
00125 return nodeMap.end();
00126 }
00127 NodeMap::container::const_iterator nodeBegin() const {
00128 return nodeMap.begin();
00129 }
00130
00136 bool contains(Edge *e) { return (edges.find(e) != edges.end()); }
00137
00138
00139 };
00140
00141
00142 }
00143 }
00144
00145 #endif // GEOS_PLANARGRAPH_SUBGRAPH_H
00146
00147
00148
00149
00150
00151
00152
00153