18#include <geos/operation/valid/PolygonRingTouch.h>
19#include <geos/operation/valid/PolygonRingSelfNode.h>
21#include <geos/export.h>
38class GEOS_DLL PolygonRing {
39 using CoordinateXY = geos::geom::CoordinateXY;
45 PolygonRing* shell =
nullptr;
46 const LinearRing* ring =
nullptr;
52 PolygonRing* touchSetRoot =
nullptr;
66 std::map<int, PolygonRingTouch> touches;
72 std::vector<PolygonRingSelfNode> selfNodes;
84 bool isOnlyTouch(
const PolygonRing* polyRing,
const CoordinateXY& pt)
const;
94 const CoordinateXY* findHoleCycleLocation();
96 void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
106 const CoordinateXY* scanForHoleCycle(PolygonRingTouch* currentTouch,
108 std::stack<PolygonRingTouch*>& touchStack);
111 bool isInTouchSet()
const
113 return touchSetRoot !=
nullptr;
116 void setTouchSetRoot(PolygonRing* polyRing)
118 touchSetRoot = polyRing;
121 PolygonRing* getTouchSetRoot()
const
126 bool hasTouches()
const
128 return ! touches.empty();
131 std::vector<PolygonRingTouch*> getTouches()
const;
133 void addTouch(PolygonRing* polyRing,
const CoordinateXY& pt);
144 PolygonRing(
const LinearRing* p_ring,
int p_index, PolygonRing* p_shell)
154 PolygonRing(
const LinearRing* p_ring)
155 : PolygonRing(p_ring, -1, this)
164 static bool isShell(
const PolygonRing* polyRing);
175 static bool addTouch(PolygonRing* ring0, PolygonRing* ring1,
const CoordinateXY& pt);
186 static const CoordinateXY* findHoleCycleLocation(std::vector<PolygonRing*> polyRings);
197 static const CoordinateXY* findInteriorSelfNode(std::vector<PolygonRing*> polyRings);
199 bool isSamePolygon(
const PolygonRing* polyRing)
const
201 return shell == polyRing->shell;
206 return shell ==
this;
209 void addSelfTouch(
const CoordinateXY& origin,
210 const CoordinateXY* e00,
const CoordinateXY* e01,
211 const CoordinateXY* e10,
const CoordinateXY* e11);
219 const CoordinateXY* findInteriorSelfNode();
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Basic namespace for all GEOS functionalities.
Definition geos.h:39