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),
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];
224 return hasIntersection() && isProperVar;
283 int intLineIndex[2][2];
292 return result == COLLINEAR_INTERSECTION;
301 return hasIntersection() && !isProperVar;
304 void computeIntLineIndex();
306 void computeIntLineIndex(
int segmentIndex);
359 #endif // GEOS_ALGORITHM_LINEINTERSECTOR_H
bool hasIntersection() const
Definition: LineIntersector.h:161
size_t getIntersectionNum() const
Returns the number of intersection points found.
Definition: LineIntersector.h:171
int getIndexAlongSegment(int segmentIndex, int intIndex)
Computes the index of the intIndex'th intersection point in the direction of a specified input line s...
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
bool isInteriorIntersection(int inputLineIndex)
Tests whether either intersection point is an interior point of the specified input segment.
bool isProper() const
Tests whether an intersection is proper.
Definition: LineIntersector.h:222
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
double getEdgeDistance(size_t geomIndex, size_t intIndex) const
Computes the "edge distance" of an intersection point along the specified input line segment.
const geom::Coordinate & getIntersection(size_t intIndex) const
Returns the intIndex'th intersection point.
Definition: LineIntersector.h:184
static double interpolateZ(const geom::Coordinate &p, const geom::Coordinate &p0, const geom::Coordinate &p1)
Return a Z value being the interpolation of Z from p0 and p1 at the given point p.
bool isInteriorIntersection()
Tests whether either intersection point is an interior point of one of the input segments.
void computeIntersection(const geom::Coordinate &p, const geom::Coordinate &p1, const geom::Coordinate &p2)
Compute the intersection of a point p and the line p1-p2.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:84
void setPrecisionModel(const geom::PrecisionModel *newPM)
Force computed intersection to be rounded to a given precision model.
Definition: LineIntersector.h:115
static bool hasIntersection(const geom::Coordinate &p, const geom::Coordinate &p1, const geom::Coordinate &p2)
Same as above but doen's compute intersection point. Faster.
const geom::Coordinate & getIntersectionAlongSegment(int segmentIndex, int intIndex)
Computes the intIndex'th intersection point in the direction of a specified input line segment.
static double computeEdgeDistance(const geom::Coordinate &p, const geom::Coordinate &p0, const geom::Coordinate &p1)
Computes the "edge distance" of an intersection point p in an edge.
bool isIntersection(const geom::Coordinate &pt) const
Test whether a point is a intersection point of two line segments.
static bool isSameSignAndNonZero(double a, double b)
Returns false if both numbers are zero.
void computeIntersection(const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &p3, const geom::Coordinate &p4)
Computes the intersection of the lines p1-p2 and p3-p4.