16 #ifndef GEOS_GEOM_PREP_SEGMENTINTERSECTIONDETECTOR_H
17 #define GEOS_GEOM_PREP_SEGMENTINTERSECTIONDETECTOR_H
20 #include <geos/noding/SegmentIntersector.h>
21 #include <geos/algorithm/LineIntersector.h>
22 #include <geos/geom/Coordinate.h>
23 #include <geos/geom/CoordinateArraySequence.h>
24 #include <geos/noding/SegmentString.h>
42 class SegmentIntersectionDetector :
public SegmentIntersector {
44 algorithm::LineIntersector* li;
49 bool _hasIntersection;
50 bool _hasProperIntersection;
51 bool _hasNonProperIntersection;
53 const geom::Coordinate* intPt;
54 geom::CoordinateArraySequence* intSegments;
58 SegmentIntersectionDetector(algorithm::LineIntersector* p_li)
63 _hasIntersection(false),
64 _hasProperIntersection(false),
65 _hasNonProperIntersection(false),
78 setFindProper(
bool p_findProper)
80 this->findProper = p_findProper;
84 setFindAllIntersectionTypes(
bool p_findAllTypes)
86 this->findAllTypes = p_findAllTypes;
97 return _hasIntersection;
108 return _hasProperIntersection;
119 return _hasNonProperIntersection;
128 const geom::Coordinate*
152 return _hasProperIntersection && _hasNonProperIntersection;
157 return _hasProperIntersection;
160 return _hasIntersection;
172 noding::SegmentString* e1,
size_t segIndex1)
override;
179 #endif // GEOS_GEOM_PREP_SEGMENTINTERSECTIONDETECTOR_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:24
bool hasNonProperIntersection() const
Tests whether a non-proper intersection was found.
Definition: SegmentIntersectionDetector.h:152
bool isDone() const override
Reports whether the client of this class needs to continue testing all intersections in an arrangemen...
Definition: SegmentIntersectionDetector.h:182
bool hasProperIntersection() const
Tests whether a proper intersection was found.
Definition: SegmentIntersectionDetector.h:141
bool hasIntersection() const
Tests whether an intersection was found.
Definition: SegmentIntersectionDetector.h:130
void processIntersections(noding::SegmentString *e0, size_t segIndex0, noding::SegmentString *e1, size_t segIndex1) override
This method is called by clients of the SegmentIntersector class to process intersections for two seg...
const geom::Coordinate * getIntersection() const
Gets the computed location of the intersection. Due to round-off, the location may not be exact.
Definition: SegmentIntersectionDetector.h:164
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:57
const geom::CoordinateSequence * getIntersectionSegments() const
Gets the endpoints of the intersecting segments.
Definition: SegmentIntersectionDetector.h:176
Detects and records an intersection between two SegmentStrings, if one exists.
Definition: SegmentIntersectionDetector.h:65