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>
43 class 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);
73 static std::size_t intersectingSegIndex(
const CoordinateSequence* ringPts,
const Coordinate* pt);
75 static std::size_t ringIndexPrev(
const CoordinateSequence* ringPts, std::size_t index);
77 std::vector<SegmentString*> createSegmentStrings(
const Geometry* geom,
bool isInvertedRingValid);
79 std::vector<PolygonRing*> getPolygonRings(
const std::vector<SegmentString*>& segStrings);
81 SegmentString* createSegString(
const LinearRing* ring,
const PolygonRing* polyRing);
84 PolygonTopologyAnalyzer(
const PolygonTopologyAnalyzer& other) =
delete;
85 PolygonTopologyAnalyzer& operator=(
const PolygonTopologyAnalyzer& rhs) =
delete;
90 PolygonTopologyAnalyzer(
const Geometry* geom,
bool p_isInvertedRingValid);
98 static Coordinate findSelfIntersection(
const LinearRing* ring);
115 isSegmentInRing(
const Coordinate* p0,
const Coordinate* p1,
116 const LinearRing* ring);
135 static bool isIncidentSegmentInRing(
const Coordinate* p0,
const Coordinate* p1,
136 const CoordinateSequence* ringPts);
139 bool hasInvalidIntersection() {
140 return segInt.isInvalid();
143 int getInvalidCode() {
144 return segInt.getInvalidCode();
147 const Coordinate& getInvalidLocation() {
148 return segInt.getInvalidLocation();
159 bool isInteriorDisconnected();
161 const Coordinate& getDisconnectionLocation()
const
163 return disconnectionPt;
179 void checkInteriorDisconnectedByHoleCycle();
190 void checkInteriorDisconnectedBySelfTouch();
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:57
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26