19 #ifndef GEOS_NODING_SEGMENTPOINTCOMPARATOR_H
20 #define GEOS_NODING_SEGMENTPOINTCOMPARATOR_H
22 #include <geos/export.h>
23 #include <geos/geom/Coordinate.h>
61 int xSign = relativeSign(p0.
x, p1.
x);
62 int ySign = relativeSign(p0.
y, p1.
y);
66 return compareValue(xSign, ySign);
68 return compareValue(ySign, xSign);
70 return compareValue(ySign, -xSign);
72 return compareValue(-xSign, ySign);
74 return compareValue(-xSign, -ySign);
76 return compareValue(-ySign, -xSign);
78 return compareValue(-ySign, xSign);
80 return compareValue(xSign, -ySign);
88 relativeSign(
double x0,
double x1)
100 compareValue(
int compareSign0,
int compareSign1)
102 if(compareSign0 < 0) {
105 if(compareSign0 > 0) {
108 if(compareSign1 < 0) {
111 if(compareSign1 > 0) {
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
double y
y-coordinate
Definition: Coordinate.h:83
double x
x-coordinate
Definition: Coordinate.h:80
Implements a robust method of comparing the relative position of two points along the same segment.
Definition: SegmentPointComparator.h:40
static int compare(int octant, const geom::Coordinate &p0, const geom::Coordinate &p1)
Compares two Coordinates for their relative position along a segment lying in the specified Octant.
Definition: SegmentPointComparator.h:53
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26