18#include <geos/operation/valid/PolygonRingTouch.h>
19#include <geos/operation/valid/PolygonRingSelfNode.h>
21#include <geos/export.h>
37class GEOS_DLL PolygonRing {
38 using CoordinateXY = geos::geom::CoordinateXY;
44 PolygonRing* shell =
nullptr;
45 const LinearRing* ring =
nullptr;
51 PolygonRing* touchSetRoot =
nullptr;
65 std::map<int, PolygonRingTouch> touches;
71 std::vector<PolygonRingSelfNode> selfNodes;
83 bool isOnlyTouch(
const PolygonRing* polyRing,
const CoordinateXY& pt)
const;
93 const CoordinateXY* findHoleCycleLocation();
95 static void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
105 static const CoordinateXY* scanForHoleCycle(
const PolygonRingTouch* currentTouch,
107 std::stack<PolygonRingTouch*>& touchStack);
110 bool isInTouchSet()
const
112 return touchSetRoot !=
nullptr;
115 void setTouchSetRoot(PolygonRing* polyRing)
117 touchSetRoot = polyRing;
120 PolygonRing* getTouchSetRoot()
const
125 bool hasTouches()
const
127 return ! touches.empty();
130 std::vector<PolygonRingTouch*> getTouches()
const;
132 void addTouch(PolygonRing* polyRing,
const CoordinateXY& pt);
143 PolygonRing(
const LinearRing* p_ring,
int p_index, PolygonRing* p_shell)
153 PolygonRing(
const LinearRing* p_ring)
154 : PolygonRing(p_ring, -1, this)
163 static bool isShell(
const PolygonRing* polyRing);
174 static bool addTouch(PolygonRing* ring0, PolygonRing* ring1,
const CoordinateXY& pt);
185 static const CoordinateXY* findHoleCycleLocation(
const std::vector<PolygonRing*>& polyRings);
196 static const CoordinateXY* findInteriorSelfNode(
const std::vector<PolygonRing*>& polyRings);
198 bool isSamePolygon(
const PolygonRing* polyRing)
const
200 return shell == polyRing->shell;
205 return shell ==
this;
208 void addSelfTouch(
const CoordinateXY& origin,
209 const CoordinateXY* e00,
const CoordinateXY* e01,
210 const CoordinateXY* e10,
const CoordinateXY* e11);
218 const CoordinateXY* findInteriorSelfNode()
const;
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:38