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 <geos/export.h>
00026 #include <map>
00027 #include <vector>
00028 #include <memory>
00029
00030 #include <geos/geom/Coordinate.h>
00031 #include <geos/geomgraph/PlanarGraph.h>
00032 #include <geos/geomgraph/NodeMap.h>
00033
00034 #include <geos/inline.h>
00035
00036
00037 namespace geos {
00038 namespace geom {
00039 class Coordinate;
00040 }
00041 namespace geomgraph {
00042 class Edge;
00043 class Node;
00044 class EdgeEnd;
00045 class NodeFactory;
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace geomgraph {
00051
00075 class GEOS_DLL PlanarGraph {
00076 public:
00077
00086 static void linkResultDirectedEdges(
00087 std::vector<Node*>::iterator start,
00088 std::vector<Node*>::iterator end);
00089
00090
00091 PlanarGraph(const NodeFactory &nodeFact);
00092
00093 PlanarGraph();
00094
00095 virtual ~PlanarGraph();
00096
00097 virtual std::vector<Edge*>::iterator getEdgeIterator();
00098
00099 virtual std::vector<EdgeEnd*>* getEdgeEnds();
00100
00101 virtual bool isBoundaryNode(int geomIndex, const geom::Coordinate& coord);
00102
00103 virtual void add(EdgeEnd *e);
00104
00105 virtual NodeMap::iterator getNodeIterator();
00106
00107 virtual void getNodes(std::vector<Node*>&);
00108
00109 virtual Node* addNode(Node *node);
00110
00111 virtual Node* addNode(const geom::Coordinate& coord);
00112
00116 virtual Node* find(geom::Coordinate& coord);
00117
00122 virtual void addEdges(const std::vector<Edge*> &edgesToAdd);
00123
00124 virtual void linkResultDirectedEdges();
00125
00126 virtual void linkAllDirectedEdges();
00127
00135 virtual EdgeEnd* findEdgeEnd(Edge *e);
00136
00143 virtual Edge* findEdge(const geom::Coordinate& p0,
00144 const geom::Coordinate& p1);
00145
00153 virtual Edge* findEdgeInSameDirection(const geom::Coordinate& p0,
00154 const geom::Coordinate& p1);
00155
00156 virtual std::string printEdges();
00157
00158 virtual NodeMap* getNodeMap();
00159
00160 protected:
00161
00162 std::vector<Edge*> *edges;
00163
00164 NodeMap *nodes;
00165
00166 std::vector<EdgeEnd*> *edgeEndList;
00167
00168 virtual void insertEdge(Edge *e);
00169
00170 private:
00171
00179 bool matchInSameDirection(const geom::Coordinate& p0,
00180 const geom::Coordinate& p1,
00181 const geom::Coordinate& ep0,
00182 const geom::Coordinate& ep1);
00183 };
00184
00185
00186
00187 }
00188 }
00189
00190
00191
00192
00193
00194 #endif // ifndef GEOS_GEOMGRAPH_PLANARGRAPH_H
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214