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_EDGEEND_H
00023 #define GEOS_GEOMGRAPH_EDGEEND_H
00024
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/inline.h>
00027
00028 #include <string>
00029
00030
00031 namespace geos {
00032 namespace geomgraph {
00033 class Label;
00034 class Edge;
00035 class Node;
00036 }
00037 }
00038
00039 namespace geos {
00040 namespace geomgraph {
00041
00052 class EdgeEnd {
00053
00054 public:
00055
00056 friend std::ostream& operator<< (std::ostream&, const EdgeEnd&);
00057
00058 EdgeEnd();
00059
00060 virtual ~EdgeEnd();
00061
00069 EdgeEnd(Edge* newEdge, const geom::Coordinate& newP0,
00070 const geom::Coordinate& newP1,
00071 Label* newLabel=NULL);
00072
00073 Edge* getEdge() { return edge; }
00074
00075
00076 virtual Label* getLabel();
00077
00078 virtual geom::Coordinate& getCoordinate();
00079
00080 virtual geom::Coordinate& getDirectedCoordinate();
00081
00082 virtual int getQuadrant();
00083
00084 virtual double getDx();
00085
00086 virtual double getDy();
00087
00088 virtual void setNode(Node* newNode);
00089
00090 virtual Node* getNode();
00091
00092 virtual int compareTo(const EdgeEnd *e) const;
00093
00110 virtual int compareDirection(const EdgeEnd *e) const;
00111
00112 virtual void computeLabel();
00113
00114 virtual std::string print();
00115
00116 protected:
00117
00118 Edge* edge;
00119
00120 Label* label;
00121
00122 EdgeEnd(Edge* newEdge);
00123
00124 virtual void init(const geom::Coordinate& newP0,
00125 const geom::Coordinate& newP1);
00126
00127 private:
00128
00130 Node* node;
00131
00133 geom::Coordinate p0, p1;
00134
00136 double dx, dy;
00137
00138 int quadrant;
00139 };
00140
00141 std::ostream& operator<< (std::ostream&, const EdgeEnd&);
00142
00143 struct EdgeEndLT {
00144 bool operator()(const EdgeEnd *s1, const EdgeEnd *s2) const {
00145 return s1->compareTo(s2)<0;
00146 }
00147 };
00148
00149 }
00150 }
00151
00152
00153
00154
00155
00156 #endif // ifndef GEOS_GEOMGRAPH_EDGEEND_H
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179