00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_GEOMGRAPH_PLANARGRAPH_H
00023 #define GEOS_GEOMGRAPH_PLANARGRAPH_H
00024
00025 #include <map>
00026 #include <vector>
00027 #include <memory>
00028
00029 #include <geos/geom/Coordinate.h>
00030 #include <geos/geomgraph/PlanarGraph.h>
00031 #include <geos/geomgraph/NodeMap.h>
00032
00033 #include <geos/inline.h>
00034
00035
00036 namespace geos {
00037 namespace geom {
00038 class Coordinate;
00039 }
00040 namespace geomgraph {
00041 class Edge;
00042 class Node;
00043 class EdgeEnd;
00044 class NodeFactory;
00045 }
00046 }
00047
00048 namespace geos {
00049 namespace geomgraph {
00050
00074 class PlanarGraph {
00075 public:
00076
00085 static void linkResultDirectedEdges(
00086 std::vector<Node*>::iterator start,
00087 std::vector<Node*>::iterator end);
00088
00089
00090 PlanarGraph(const NodeFactory &nodeFact);
00091
00092 PlanarGraph();
00093
00094 virtual ~PlanarGraph();
00095
00096 virtual std::vector<Edge*>::iterator getEdgeIterator();
00097
00098 virtual std::vector<EdgeEnd*>* getEdgeEnds();
00099
00100 virtual bool isBoundaryNode(int geomIndex, const geom::Coordinate& coord);
00101
00102 virtual void add(EdgeEnd *e);
00103
00104 virtual NodeMap::iterator getNodeIterator();
00105
00106 virtual void getNodes(std::vector<Node*>&);
00107
00108 virtual Node* addNode(Node *node);
00109
00110 virtual Node* addNode(const geom::Coordinate& coord);
00111
00115 virtual Node* find(geom::Coordinate& coord);
00116
00121 virtual void addEdges(const std::vector<Edge*> &edgesToAdd);
00122
00123 virtual void linkResultDirectedEdges();
00124
00125 virtual void linkAllDirectedEdges();
00126
00134 virtual EdgeEnd* findEdgeEnd(Edge *e);
00135
00142 virtual Edge* findEdge(const geom::Coordinate& p0,
00143 const geom::Coordinate& p1);
00144
00152 virtual Edge* findEdgeInSameDirection(const geom::Coordinate& p0,
00153 const geom::Coordinate& p1);
00154
00155 virtual std::string printEdges();
00156
00157 virtual NodeMap* getNodeMap();
00158
00159 protected:
00160
00161 std::vector<Edge*> *edges;
00162
00163 NodeMap *nodes;
00164
00165 std::vector<EdgeEnd*> *edgeEndList;
00166
00167 virtual void insertEdge(Edge *e);
00168
00169 private:
00170
00178 bool matchInSameDirection(const geom::Coordinate& p0,
00179 const geom::Coordinate& p1,
00180 const geom::Coordinate& ep0,
00181 const geom::Coordinate& ep1);
00182 };
00183
00184
00185
00186 }
00187 }
00188
00189
00190
00191
00192
00193 #endif // ifndef GEOS_GEOMGRAPH_PLANARGRAPH_H
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213