00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_PLANARGRAPH_DIRECTEDEDGE_H
00018 #define GEOS_PLANARGRAPH_DIRECTEDEDGE_H
00019
00020 #include <geos/export.h>
00021 #include <geos/planargraph/GraphComponent.h>
00022 #include <geos/geom/Coordinate.h>
00023
00024 #include <vector>
00025 #include <list>
00026
00027
00028 namespace geos {
00029 namespace planargraph {
00030 class Edge;
00031 class Node;
00032 }
00033 }
00034
00035 namespace geos {
00036 namespace planargraph {
00037
00047 class GEOS_DLL DirectedEdge: public GraphComponent {
00048
00049 public:
00050
00051 typedef std::list<DirectedEdge *> NonConstList;
00052 typedef std::list<const DirectedEdge *> ConstList;
00053 typedef std::vector<DirectedEdge *> NonConstVect;
00054
00055 protected:
00056 Edge* parentEdge;
00057 Node* from;
00058 Node* to;
00059 geom::Coordinate p0, p1;
00060 DirectedEdge* sym;
00061 bool edgeDirection;
00062 int quadrant;
00063 double angle;
00064 public:
00065
00066 typedef std::vector<const DirectedEdge *> ConstVect;
00067 typedef std::vector<DirectedEdge *> Vect;
00068
00078 static std::vector<Edge*>* toEdges(
00079 std::vector<DirectedEdge*>& dirEdges);
00080
00089 static void toEdges( std::vector<DirectedEdge*>& dirEdges,
00090 std::vector<Edge*>& parentEdges);
00091
00104 DirectedEdge(Node *newFrom, Node *newTo,
00105 const geom::Coordinate &directionPt,
00106 bool newEdgeDirection);
00107
00112 Edge* getEdge() const;
00113
00118 void setEdge(Edge* newParentEdge);
00119
00124 int getQuadrant() const;
00125
00130 const geom::Coordinate& getDirectionPt() const;
00131
00136 bool getEdgeDirection() const;
00137
00141 Node* getFromNode() const;
00142
00146 Node* getToNode() const;
00147
00152 geom::Coordinate& getCoordinate() const;
00153
00159 double getAngle() const;
00160
00166 DirectedEdge* getSym() const;
00167
00173 void setSym(DirectedEdge *newSym);
00174
00194 int compareTo(const DirectedEdge* obj) const;
00195
00215 int compareDirection(const DirectedEdge *e) const;
00216
00222 std::string print() const;
00223
00224 };
00225
00227 bool pdeLessThan(DirectedEdge *first, DirectedEdge * second);
00228
00229
00230
00231 }
00232 }
00233
00234 #endif // GEOS_PLANARGRAPH_DIRECTEDEDGE_H
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245