20#ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H
21#define GEOS_ALGORITHM_LINEINTERSECTOR_H
23#include <geos/export.h>
26#include <geos/geom/Coordinate.h>
49class GEOS_DLL LineIntersector {
82 precisionModel(initialPrecisionModel),
114 precisionModel=newPM;
150 std::string toString()
const;
173 return intPt[intIndex];
274 int intLineIndex[2][2];
284 bool isEndPoint()
const {
285 return hasIntersection()&&!isProperVar;
288 void computeIntLineIndex();
290 void computeIntLineIndex(
int segmentIndex);
311 double smallestInAbsValue(
double x1,
double x2,
312 double x3,
double x4)
const;
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
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.
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.
int getIntersectionNum() const
Returns the number of intersection points found.
Definition LineIntersector.h:163
const geom::Coordinate & getIntersectionAlongSegment(int segmentIndex, int intIndex)
Computes the intIndex'th intersection point in the direction of a specified input line segment.
bool isInteriorIntersection(int inputLineIndex)
Tests whether either intersection point is an interior point of the specified input segment.
void setPrecisionModel(const geom::PrecisionModel *newPM)
Force computed intersection to be rounded to a given precision model.
Definition LineIntersector.h:113
bool isInteriorIntersection()
Tests whether either intersection point is an interior point of one of the input segments.
double getEdgeDistance(int geomIndex, int intIndex) const
Computes the "edge distance" of an intersection point along the specified input line segment.
bool hasIntersection() const
Definition LineIntersector.h:157
static bool isSameSignAndNonZero(double a, double b)
Returns false if both numbers are zero.
@ NO_INTERSECTION
Indicates that line segments do not intersect.
Definition LineIntersector.h:137
@ COLLINEAR_INTERSECTION
Indicates that line segments intersect in a line segment.
Definition LineIntersector.h:143
@ POINT_INTERSECTION
Indicates that line segments intersect in a single point.
Definition LineIntersector.h:140
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.
int getIndexAlongSegment(int segmentIndex, int intIndex)
Computes the index of the intIndex'th intersection point in the direction of a specified input line s...
bool isProper() const
Tests whether an intersection is proper.
Definition LineIntersector.h:208
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.
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 isIntersection(const geom::Coordinate &pt) const
Test whether a point is a intersection point of two line segments.
const geom::Coordinate & getIntersection(int intIndex) const
Returns the intIndex'th intersection point.
Definition LineIntersector.h:172
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
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25