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