20 #ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H
21 #define GEOS_ALGORITHM_LINEINTERSECTOR_H
23 #include <geos/inline.h>
24 #include <geos/export.h>
27 #include <geos/geom/Coordinate.h>
84 precisionModel(initialPrecisionModel),
118 precisionModel = newPM;
137 POINT_INTERSECTION = 1,
140 COLLINEAR_INTERSECTION = 2
147 std::string toString()
const;
157 return result != NO_INTERSECTION;
171 return inputLines[segmentIndex][ptIndex];
194 return intPt[intIndex];
232 return hasIntersection() && isProperVar;
291 std::size_t intLineIndex[2][2];
300 return result == COLLINEAR_INTERSECTION;
309 return hasIntersection() && !isProperVar;
312 void computeIntLineIndex();
314 void computeIntLineIndex(std::size_t segmentIndex);
415 # include "geos/algorithm/LineIntersector.inl"
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:50
intersection_type
Definition: LineIntersector.h:132
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.
const geom::Coordinate * getEndpoint(std::size_t segmentIndex, std::size_t ptIndex) const
Definition: LineIntersector.h:169
const geom::Coordinate & getIntersectionAlongSegment(std::size_t segmentIndex, std::size_t intIndex)
Computes the intIndex'th intersection point in the direction of a specified input line segment.
static bool hasIntersection(const geom::Coordinate &p, const geom::Coordinate &p1, const geom::Coordinate &p2)
Same as above but doesn't compute intersection point. Faster.
bool isInteriorIntersection(std::size_t inputLineIndex)
Tests whether either intersection point is an interior point of the specified input segment.
void setPrecisionModel(const geom::PrecisionModel *newPM)
Definition: LineIntersector.h:116
bool isInteriorIntersection()
Tests whether either intersection point is an interior point of one of the input segments.
const geom::Coordinate & getIntersection(std::size_t intIndex) const
Definition: LineIntersector.h:192
bool hasIntersection() const
Definition: LineIntersector.h:155
static bool isSameSignAndNonZero(double a, double b)
void computeIntersection(const geom::Coordinate &p, const geom::Coordinate &p1, const geom::Coordinate &p2)
bool isProper() const
Tests whether an intersection is proper.
Definition: LineIntersector.h:230
static double computeEdgeDistance(const geom::Coordinate &p, const geom::Coordinate &p0, const geom::Coordinate &p1)
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.
size_t getIntersectionNum() const
Definition: LineIntersector.h:179
double getEdgeDistance(std::size_t geomIndex, std::size_t intIndex) const
Computes the "edge distance" of an intersection point along the specified input line segment.
std::size_t getIndexAlongSegment(std::size_t segmentIndex, std::size_t intIndex)
Computes the index of the intIndex'th intersection point in the direction of a specified input line s...
bool isIntersection(const geom::Coordinate &pt) const
Test whether a point is a intersection point of two line segments.
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
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26