17#include <geos/operation/overlayng/OverlayLabel.h>
18#include <geos/operation/overlayng/EdgeKey.h>
19#include <geos/operation/overlayng/Edge.h>
20#include <geos/geom/Coordinate.h>
21#include <geos/export.h>
30using geos::geom::Coordinate;
41class GEOS_DLL EdgeKey {
52 void initPoints(
const Edge* edge)
54 bool direction = edge->direction();
56 init(edge->getCoordinate(0),
57 edge->getCoordinate(1));
60 std::size_t len = edge->size();
61 init(edge->getCoordinate(len - 1),
62 edge->getCoordinate(len - 2));
77 EdgeKey(
const Edge* edge)
82 int compareTo(
const EdgeKey* ek)
const
84 if (p0x < ek->p0x)
return -1;
85 if (p0x > ek->p0x)
return 1;
86 if (p0y < ek->p0y)
return -1;
87 if (p0y > ek->p0y)
return 1;
89 if (p1x < ek->p1x)
return -1;
90 if (p1x > ek->p1x)
return 1;
91 if (p1y < ek->p1y)
return -1;
92 if (p1y > ek->p1y)
return 1;
96 bool equals(
const EdgeKey* ek)
const
104 friend bool operator<(
const EdgeKey& ek1,
const EdgeKey& ek2)
106 return ek1.compareTo(&ek2) < 0;
109 friend bool operator==(
const EdgeKey& ek1,
const EdgeKey& ek2)
111 return ek1.equals(&ek2);
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Definition operation/overlayng/Edge.h:55
Provides classes for implementing operations on geometries.
Definition namespaces.h:179
Basic namespace for all GEOS functionalities.
Definition geos.h:39