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 protected:
00052 PlanarGraph &parentGraph;
00053 std::set<Edge*> edges;
00054 std::vector<const DirectedEdge*> dirEdges;
00055 NodeMap nodeMap;
00056
00057 public:
00063 Subgraph(PlanarGraph &parent)
00064 :
00065 parentGraph(parent)
00066 {}
00067
00074 PlanarGraph& getParent() const { return parentGraph; }
00075
00089 std::pair<std::set<Edge*>::iterator, bool> add(Edge *e);
00090
00099 std::vector<const DirectedEdge*>::iterator getDirEdgeBegin() {
00100 return dirEdges.begin();
00101 }
00102
00103
00112 std::set<Edge*>::iterator edgeBegin() { return edges.begin(); }
00113 std::set<Edge*>::iterator edgeEnd() { return edges.end(); }
00114
00119 NodeMap::container::iterator nodeBegin() {
00120 return nodeMap.begin();
00121 }
00122 NodeMap::container::const_iterator nodeEnd() const {
00123 return nodeMap.end();
00124 }
00125 NodeMap::container::iterator nodeEnd() {
00126 return nodeMap.end();
00127 }
00128 NodeMap::container::const_iterator nodeBegin() const {
00129 return nodeMap.begin();
00130 }
00131
00137 bool contains(Edge *e) { return (edges.find(e) != edges.end()); }
00138
00139
00140 };
00141
00142
00143 }
00144 }
00145
00146 #endif // GEOS_PLANARGRAPH_SUBGRAPH_H
00147
00148
00149
00150
00151
00152
00153
00154