18#include <geos/export.h>
20#include <geos/operation/valid/PolygonIntersectionAnalyzer.h>
21#include <geos/operation/valid/PolygonRing.h>
22#include <geos/noding/BasicSegmentString.h>
43class GEOS_DLL PolygonTopologyAnalyzer {
48 bool isInvertedRingValid =
false;
49 PolygonIntersectionAnalyzer segInt;
50 std::vector<PolygonRing*> polyRings;
51 geom::Coordinate disconnectionPt;
56 std::deque<PolygonRing> polyRingStore;
57 std::deque<noding::BasicSegmentString> segStringStore;
62 std::vector<std::unique_ptr<CoordinateSequence>> coordSeqStore;
64 PolygonRing* createPolygonRing(
const LinearRing* p_ring);
65 PolygonRing* createPolygonRing(
const LinearRing* p_ring,
int p_index, PolygonRing* p_shell);
67 static const Coordinate&
68 findNonEqualVertex(
const LinearRing* ring,
const Coordinate& p);
87 static bool isIncidentSegmentInRing(
const Coordinate* p0,
const Coordinate* p1,
88 const CoordinateSequence* ringPts);
90 static const Coordinate& findRingVertexPrev(
const CoordinateSequence* ringPts,
91 std::size_t index,
const Coordinate& node);
93 static const Coordinate& findRingVertexNext(
const CoordinateSequence* ringPts,
94 std::size_t index,
const Coordinate& node);
96 static std::size_t ringIndexPrev(
const CoordinateSequence* ringPts, std::size_t index);
98 static std::size_t ringIndexNext(
const CoordinateSequence* ringPts, std::size_t index);
106 static std::size_t intersectingSegIndex(
const CoordinateSequence* ringPts,
const Coordinate* pt);
108 std::vector<SegmentString*> createSegmentStrings(
const Geometry* geom,
bool isInvertedRingValid);
110 std::vector<PolygonRing*> getPolygonRings(
const std::vector<SegmentString*>& segStrings);
112 SegmentString* createSegString(
const LinearRing* ring,
const PolygonRing* polyRing);
115 PolygonTopologyAnalyzer(
const PolygonTopologyAnalyzer& other) =
delete;
116 PolygonTopologyAnalyzer& operator=(
const PolygonTopologyAnalyzer& rhs) =
delete;
121 PolygonTopologyAnalyzer(
const Geometry* geom,
bool p_isInvertedRingValid);
129 static Coordinate findSelfIntersection(
const LinearRing* ring);
150 isRingNested(
const LinearRing* test,
151 const LinearRing* target);
153 bool hasInvalidIntersection() {
154 return segInt.isInvalid();
157 int getInvalidCode() {
158 return segInt.getInvalidCode();
161 const Coordinate& getInvalidLocation() {
162 return segInt.getInvalidLocation();
173 bool isInteriorDisconnected();
175 const Coordinate& getDisconnectionLocation()
const
177 return disconnectionPt;
193 void checkInteriorDisconnectedByHoleCycle();
204 void checkInteriorDisconnectedBySelfTouch();
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:55
Basic namespace for all GEOS functionalities.
Definition: geos.h:39