20 #ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H 21 #define GEOS_ALGORITHM_LINEINTERSECTOR_H 23 #include <geos/export.h> 26 #include <geos/geom/Coordinate.h> 83 precisionModel(initialPrecisionModel),
97 bool isInteriorIntersection();
106 bool isInteriorIntersection(
int inputLineIndex);
117 precisionModel = newPM;
143 POINT_INTERSECTION = 1,
146 COLLINEAR_INTERSECTION = 2
153 std::string toString()
const;
163 return result != NO_INTERSECTION;
186 return intPt[intIndex];
193 static bool isSameSignAndNonZero(
double a,
double b);
224 return hasIntersection() && isProperVar;
237 const geom::Coordinate& getIntersectionAlongSegment(
int segmentIndex,
int intIndex);
248 int getIndexAlongSegment(
int segmentIndex,
int intIndex);
259 double getEdgeDistance(
size_t geomIndex,
size_t intIndex)
const;
283 int intLineIndex[2][2];
292 return result == COLLINEAR_INTERSECTION;
301 return hasIntersection() && !isProperVar;
304 void computeIntLineIndex();
306 void computeIntLineIndex(
int segmentIndex);
308 int computeCollinearIntersection(
const geom::Coordinate& p1,
const geom::Coordinate& p2,
309 const geom::Coordinate& q1,
const geom::Coordinate& q2);
320 geom::Coordinate intersection(
const geom::Coordinate& p1,
321 const geom::Coordinate& p2,
322 const geom::Coordinate& q1,
323 const geom::Coordinate& q2)
const;
335 bool isInSegmentEnvelopes(
const geom::Coordinate& intPt)
const;
350 geom::Coordinate intersectionSafe(
const geom::Coordinate& p1,
const geom::Coordinate& p2,
351 const geom::Coordinate& q1,
const geom::Coordinate& q2)
const;
359 #endif // GEOS_ALGORITHM_LINEINTERSECTOR_H size_t getIntersectionNum() const
Returns the number of intersection points found.
Definition: LineIntersector.h:171
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
bool isProper() const
Tests whether an intersection is proper.
Definition: LineIntersector.h:222
bool hasIntersection() const
Definition: LineIntersector.h:161
void setPrecisionModel(const geom::PrecisionModel *newPM)
Force computed intersection to be rounded to a given precision model.
Definition: LineIntersector.h:115
const geom::Coordinate & getIntersection(size_t intIndex) const
Returns the intIndex'th intersection point.
Definition: LineIntersector.h:184