00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
00024 #define GEOS_GEOMGRAPH_EDGEINTERSECTION_H
00025
00026 #include <geos/export.h>
00027 #include <string>
00028
00029 #include <geos/geom/Coordinate.h>
00030
00031 #include <geos/inline.h>
00032
00033
00034 namespace geos {
00035 namespace geomgraph {
00036
00046 class GEOS_DLL EdgeIntersection {
00047 public:
00048
00049
00050 geom::Coordinate coord;
00051
00052
00053 int segmentIndex;
00054
00055
00056 double dist;
00057
00058 EdgeIntersection(const geom::Coordinate& newCoord,
00059 int newSegmentIndex, double newDist);
00060
00061 virtual ~EdgeIntersection();
00062
00070 int compare(int newSegmentIndex, double newDist) const;
00071
00072 bool isEndPoint(int maxSegmentIndex);
00073
00074 std::string print() const;
00075
00076 int compareTo(const EdgeIntersection *) const;
00077
00078 const geom::Coordinate& getCoordinate() const {
00079 return coord;
00080 }
00081
00082 int getSegmentIndex() const { return segmentIndex; }
00083
00084 double getDistance() { return dist; }
00085
00086 };
00087
00088 struct GEOS_DLL EdgeIntersectionLessThen {
00089 bool operator()(const EdgeIntersection *ei1,
00090 const EdgeIntersection *ei2) const
00091 {
00092 if ( ei1->segmentIndex<ei2->segmentIndex ||
00093 ( ei1->segmentIndex==ei2->segmentIndex &&
00094 ei1->dist<ei2->dist ) ) return true;
00095 return false;
00096 }
00097 };
00098
00099
00100 }
00101 }
00102
00103
00104
00105
00106
00107 #endif // ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
00108
00109