18#include <geos/noding/SegmentIntersector.h>
19#include <geos/algorithm/LineIntersector.h>
20#include <geos/operation/valid/TopologyValidationError.h>
23#include <geos/export.h>
44class GEOS_DLL PolygonIntersectionAnalyzer :
public noding::SegmentIntersector {
48 algorithm::LineIntersector li;
49 bool m_hasDoubleTouch =
false;
50 bool isInvertedRingValid =
false;
51 int invalidCode = TopologyValidationError::oNoInvalidIntersection;
52 Coordinate invalidLocation;
53 Coordinate doubleTouchLocation;
55 int findInvalidIntersection(
56 const SegmentString* ss0, std::size_t segIndex0,
57 const SegmentString* ss1, std::size_t segIndex1);
60 const SegmentString* ss0,
const SegmentString* ss1,
61 const Coordinate& intPt);
64 const SegmentString* ss,
const Coordinate& intPt,
65 const Coordinate* e00,
const Coordinate* e01,
66 const Coordinate* e10,
const Coordinate* e11);
68 const Coordinate& prevCoordinateInRing(
69 const SegmentString* ringSS, std::size_t segIndex)
const;
71 bool isAdjacentInRing(
const SegmentString* ringSS,
72 std::size_t segIndex0, std::size_t segIndex1)
const;
82 PolygonIntersectionAnalyzer(
bool p_isInvertedRingValid)
83 : isInvertedRingValid(p_isInvertedRingValid)
84 , invalidLocation(Coordinate::getNull())
85 , doubleTouchLocation(Coordinate::getNull())
88 void processIntersections(
89 SegmentString* ss0, std::size_t segIndex0,
90 SegmentString* ss1, std::size_t segIndex1)
override;
92 bool isDone()
const override {
93 return isInvalid() || m_hasDoubleTouch;
96 bool isInvalid()
const
98 return invalidCode >= 0;
101 int getInvalidCode()
const
106 const Coordinate& getInvalidLocation()
const
108 return invalidLocation;
111 bool hasDoubleTouch()
const
113 return m_hasDoubleTouch;
116 const Coordinate& getDoubleTouchLocation()
const
118 return doubleTouchLocation;
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:45
Basic namespace for all GEOS functionalities.
Definition: geos.h:39