20 #ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H
21 #define GEOS_ALGORITHM_LINEINTERSECTOR_H
23 #include <geos/export.h>
26 #include <geos/geom/Coordinate.h>
82 precisionModel(initialPrecisionModel),
96 bool isInteriorIntersection();
105 bool isInteriorIntersection(
int inputLineIndex);
114 precisionModel=newPM;
140 POINT_INTERSECTION=1,
143 COLLINEAR_INTERSECTION=2
150 std::string toString()
const;
173 return intPt[intIndex];
180 static bool isSameSignAndNonZero(
double a,
double b);
209 return hasIntersection()&&isProperVar;
222 const geom::Coordinate& getIntersectionAlongSegment(
int segmentIndex,
int intIndex);
233 int getIndexAlongSegment(
int segmentIndex,
int intIndex);
244 double getEdgeDistance(
int geomIndex,
int intIndex)
const;
274 int intLineIndex[2][2];
280 bool isCollinear()
const {
return result==COLLINEAR_INTERSECTION; }
284 bool isEndPoint()
const {
285 return hasIntersection()&&!isProperVar;
288 void computeIntLineIndex();
290 void computeIntLineIndex(
int segmentIndex);
292 int computeCollinearIntersection(
const geom::Coordinate& p1,
293 const geom::Coordinate& p2,
const geom::Coordinate& q1,
294 const geom::Coordinate& q2);
305 void intersection(
const geom::Coordinate& p1,
306 const geom::Coordinate& p2,
307 const geom::Coordinate& q1,
308 const geom::Coordinate& q2,
309 geom::Coordinate &ret)
const;
311 double smallestInAbsValue(
double x1,
double x2,
312 double x3,
double x4)
const;
324 bool isInSegmentEnvelopes(
const geom::Coordinate& intPt)
const;
337 void normalizeToEnvCentre(geom::Coordinate &n00, geom::Coordinate &n01,
338 geom::Coordinate &n10, geom::Coordinate &n11,
339 geom::Coordinate &normPt)
const;
353 void safeHCoordinateIntersection(
const geom::Coordinate& p1,
354 const geom::Coordinate& p2,
355 const geom::Coordinate& q1,
356 const geom::Coordinate& q2,
357 geom::Coordinate& intPt)
const;
365 #endif // GEOS_ALGORITHM_LINEINTERSECTOR_H
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
int getIntersectionNum() const
Returns the number of intersection points found.
Definition: LineIntersector.h:163
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
const geom::Coordinate & getIntersection(int intIndex) const
Returns the intIndex'th intersection point.
Definition: LineIntersector.h:172
bool isProper() const
Tests whether an intersection is proper.
Definition: LineIntersector.h:208
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
void setPrecisionModel(const geom::PrecisionModel *newPM)
Force computed intersection to be rounded to a given precision model.
Definition: LineIntersector.h:113
bool hasIntersection() const
Definition: LineIntersector.h:157