21 #ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H
22 #define GEOS_ALGORITHM_LINEINTERSECTOR_H
24 #include <geos/export.h>
27 #include <geos/geom/Coordinate.h>
83 precisionModel(initialPrecisionModel),
97 bool isInteriorIntersection();
106 bool isInteriorIntersection(
int inputLineIndex);
115 precisionModel=newPM;
141 POINT_INTERSECTION=1,
144 COLLINEAR_INTERSECTION=2
151 std::string toString()
const;
174 return intPt[intIndex];
181 static bool isSameSignAndNonZero(
double a,
double b);
210 return hasIntersection()&&isProperVar;
223 const geom::Coordinate& getIntersectionAlongSegment(
int segmentIndex,
int intIndex);
234 int getIndexAlongSegment(
int segmentIndex,
int intIndex);
245 double getEdgeDistance(
int geomIndex,
int intIndex)
const;
275 int intLineIndex[2][2];
281 bool isCollinear()
const {
return result==COLLINEAR_INTERSECTION; }
285 bool isEndPoint()
const {
286 return hasIntersection()&&!isProperVar;
289 void computeIntLineIndex();
291 void computeIntLineIndex(
int segmentIndex);
293 int computeCollinearIntersection(
const geom::Coordinate& p1,
294 const geom::Coordinate& p2,
const geom::Coordinate& q1,
295 const geom::Coordinate& q2);
306 void intersection(
const geom::Coordinate& p1,
307 const geom::Coordinate& p2,
308 const geom::Coordinate& q1,
309 const geom::Coordinate& q2,
310 geom::Coordinate &ret)
const;
312 double smallestInAbsValue(
double x1,
double x2,
313 double x3,
double x4)
const;
325 bool isInSegmentEnvelopes(
const geom::Coordinate& intPt)
const;
338 void normalizeToEnvCentre(geom::Coordinate &n00, geom::Coordinate &n01,
339 geom::Coordinate &n10, geom::Coordinate &n11,
340 geom::Coordinate &normPt)
const;
354 void safeHCoordinateIntersection(
const geom::Coordinate& p1,
355 const geom::Coordinate& p2,
356 const geom::Coordinate& q1,
357 const geom::Coordinate& q2,
358 geom::Coordinate& intPt)
const;
366 #endif // GEOS_ALGORITHM_LINEINTERSECTOR_H
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:61
int getIntersectionNum() const
Returns the number of intersection points found.
Definition: LineIntersector.h:164
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:88
const geom::Coordinate & getIntersection(int intIndex) const
Returns the intIndex'th intersection point.
Definition: LineIntersector.h:173
bool isProper() const
Tests whether an intersection is proper.
Definition: LineIntersector.h:209
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:50
void setPrecisionModel(const geom::PrecisionModel *newPM)
Force computed intersection to be rounded to a given precision model.
Definition: LineIntersector.h:114
bool hasIntersection() const
Definition: LineIntersector.h:158