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/planargraph/GraphComponent.h>
00021 #include <geos/geom/Coordinate.h>
00022
00023 #include <vector>
00024 #include <list>
00025
00026
00027 namespace geos {
00028 namespace planargraph {
00029 class Edge;
00030 class Node;
00031 }
00032 }
00033
00034 namespace geos {
00035 namespace planargraph {
00036
00046 class DirectedEdge: public GraphComponent {
00047
00048 public:
00049
00050 typedef std::list<DirectedEdge *> NonConstList;
00051 typedef std::list<const DirectedEdge *> ConstList;
00052 typedef std::vector<DirectedEdge *> NonConstVect;
00053
00054 protected:
00055 Edge* parentEdge;
00056 Node* from;
00057 Node* to;
00058 geom::Coordinate p0, p1;
00059 DirectedEdge* sym;
00060 bool edgeDirection;
00061 int quadrant;
00062 double angle;
00063 public:
00064
00065 typedef std::vector<const DirectedEdge *> ConstVect;
00066 typedef std::vector<DirectedEdge *> Vect;
00067
00077 static std::vector<Edge*>* toEdges(
00078 std::vector<DirectedEdge*>& dirEdges);
00079
00088 static void toEdges( std::vector<DirectedEdge*>& dirEdges,
00089 std::vector<Edge*>& parentEdges);
00090
00103 DirectedEdge(Node *newFrom, Node *newTo,
00104 const geom::Coordinate &directionPt,
00105 bool newEdgeDirection);
00106
00111 Edge* getEdge() const;
00112
00117 void setEdge(Edge* newParentEdge);
00118
00123 int getQuadrant() const;
00124
00129 const geom::Coordinate& getDirectionPt() const;
00130
00135 bool getEdgeDirection() const;
00136
00140 Node* getFromNode() const;
00141
00145 Node* getToNode() const;
00146
00151 geom::Coordinate& getCoordinate() const;
00152
00158 double getAngle() const;
00159
00165 DirectedEdge* getSym() const;
00166
00172 void setSym(DirectedEdge *newSym);
00173
00193 int compareTo(const DirectedEdge* obj) const;
00194
00214 int compareDirection(const DirectedEdge *e) const;
00215
00221 std::string print() const;
00222
00223 };
00224
00226 bool pdeLessThan(DirectedEdge *first, DirectedEdge * second);
00227
00228
00229
00230 }
00231 }
00232
00233 #endif // GEOS_PLANARGRAPH_DIRECTEDEDGE_H
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244