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/export.h>
00021 #include <geos/planargraph/NodeMap.h>
00022
00023 #include <vector>
00024
00025
00026 namespace geos {
00027 namespace planargraph {
00028 class PlanarGraph;
00029 class DirectedEdge;
00030 class Edge;
00031 }
00032 }
00033
00034 namespace geos {
00035 namespace planargraph {
00036
00038
00049 class GEOS_DLL Subgraph
00050 {
00051 public:
00057 Subgraph(PlanarGraph &parent)
00058 :
00059 parentGraph(parent)
00060 {}
00061
00068 PlanarGraph& getParent() const { return parentGraph; }
00069
00083 std::pair<std::set<Edge*>::iterator, bool> add(Edge *e);
00084
00093 std::vector<const DirectedEdge*>::iterator getDirEdgeBegin() {
00094 return dirEdges.begin();
00095 }
00096
00097
00106 std::set<Edge*>::iterator edgeBegin() { return edges.begin(); }
00107 std::set<Edge*>::iterator edgeEnd() { return edges.end(); }
00108
00113 NodeMap::container::iterator nodeBegin() {
00114 return nodeMap.begin();
00115 }
00116 NodeMap::container::const_iterator nodeEnd() const {
00117 return nodeMap.end();
00118 }
00119 NodeMap::container::iterator nodeEnd() {
00120 return nodeMap.end();
00121 }
00122 NodeMap::container::const_iterator nodeBegin() const {
00123 return nodeMap.begin();
00124 }
00125
00131 bool contains(Edge *e) { return (edges.find(e) != edges.end()); }
00132
00133 protected:
00134
00135 PlanarGraph &parentGraph;
00136 std::set<Edge*> edges;
00137 std::vector<const DirectedEdge*> dirEdges;
00138 NodeMap nodeMap;
00139
00140
00141 Subgraph(const Subgraph& other);
00142 Subgraph& operator=(const Subgraph& rhs);
00143 };
00144
00145
00146 }
00147 }
00148
00149 #endif // GEOS_PLANARGRAPH_SUBGRAPH_H
00150
00151
00152
00153
00154
00155
00156
00157