17 #include <geos/noding/SegmentIntersector.h>
18 #include <geos/geom/Coordinate.h>
19 #include <geos/noding/SegmentString.h>
26 class LineIntersector;
60 interiorIntersection(geom::Coordinate::getNull()),
62 isCheckEndSegmentsOnly(false),
63 findAllIntersections(false)
75 return !interiorIntersection.isNull();
87 return interiorIntersection;
98 return intersectionCount;
114 isCheckEndSegmentsOnly = isCESO;
131 findAllIntersections = fAI;
139 const std::vector<geom::Coordinate>&
161 return !interiorIntersection.isNull();
167 std::size_t intersectionCount;
168 bool isCheckEndSegmentsOnly;
169 bool findAllIntersections;
170 std::vector<geom::Coordinate> intSegments;
186 static bool isInteriorVertexIntersection(
188 bool isEnd0,
bool isEnd1)
191 if (isEnd0 && isEnd1) {
195 if (p0.equals2D(p1)) {
218 static bool isInteriorVertexIntersection(
219 const geom::Coordinate& p00,
const geom::Coordinate& p01,
220 const geom::Coordinate& p10,
const geom::Coordinate& p11,
221 bool isEnd00,
bool isEnd01,
bool isEnd10,
bool isEnd11)
223 if (isInteriorVertexIntersection(p00, p10, isEnd00, isEnd10)) {
226 if (isInteriorVertexIntersection(p00, p11, isEnd00, isEnd11)) {
229 if (isInteriorVertexIntersection(p01, p10, isEnd01, isEnd10)) {
232 if (isInteriorVertexIntersection(p01, p11, isEnd01, isEnd11)) {
246 static bool isEndSegment(
const SegmentString* segStr, std::size_t index)
251 if (index >= segStr->size() - 2) {
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:53
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
Finds non-noded intersections in a set of SegmentStrings, if any exist.
Definition: NodingIntersectionFinder.h:47
void setFindAllIntersections(bool fAI)
Sets whether all intersections should be computed.
Definition: NodingIntersectionFinder.h:129
void setCheckEndSegmentsOnly(bool isCESO)
Sets whether only end segments should be tested for interior intersection.
Definition: NodingIntersectionFinder.h:112
NodingIntersectionFinder(algorithm::LineIntersector &newLi)
Creates an intersection finder which finds an interior intersection if one exists.
Definition: NodingIntersectionFinder.h:57
const std::vector< geom::Coordinate > & getIntersectionSegments() const
Gets the endpoints of the intersecting segments.
Definition: NodingIntersectionFinder.h:140
bool hasIntersection() const
Tests whether an intersection was found.
Definition: NodingIntersectionFinder.h:73
void processIntersections(SegmentString *e0, std::size_t segIndex0, SegmentString *e1, std::size_t segIndex1) override
This method is called by clients of the SegmentIntersector class to process intersections for two seg...
bool isDone() const override
Reports whether the client of this class needs to continue testing all intersections in an arrangemen...
Definition: NodingIntersectionFinder.h:159
const geom::Coordinate & getInteriorIntersection() const
Gets the computed location of the intersection. Due to round-off, the location may not be exact.
Definition: NodingIntersectionFinder.h:85
size_t count() const
Gets the count of intersections found.
Definition: NodingIntersectionFinder.h:96
Processes possible intersections detected by a Noder.
Definition: noding/SegmentIntersector.h:45
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:47
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25