22 #ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
23 #define GEOS_GEOMGRAPH_EDGEINTERSECTION_H
25 #include <geos/export.h>
27 #include <geos/geom/Coordinate.h>
29 #include <geos/inline.h>
45 class GEOS_DLL EdgeIntersection {
49 geom::Coordinate coord;
57 EdgeIntersection(
const geom::Coordinate& newCoord,
58 size_t newSegmentIndex,
double newDist)
62 segmentIndex(newSegmentIndex)
66 isEndPoint(
size_t maxSegmentIndex)
const
68 if(segmentIndex == 0 && dist == 0.0) {
71 if(segmentIndex == maxSegmentIndex) {
77 const geom::Coordinate&
84 getSegmentIndex()
const
95 bool operator==(
const EdgeIntersection& other)
const {
96 return segmentIndex == other.segmentIndex &&
108 operator< (
const EdgeIntersection& ei1,
const EdgeIntersection& ei2)
110 if(ei1.segmentIndex < ei2.segmentIndex) {
113 if(ei1.segmentIndex == ei2.segmentIndex) {
114 if(ei1.dist < ei2.dist) {
126 struct GEOS_DLL EdgeIntersectionLessThen {
128 operator()(
const EdgeIntersection* ei1,
129 const EdgeIntersection* ei2)
const
135 operator()(
const EdgeIntersection& ei1,
136 const EdgeIntersection& ei2)
const
146 os << e.coord <<
" seg # = " << e.segmentIndex <<
" dist = " << e.dist;
153 #endif // ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H