18 #include <geos/operation/valid/PolygonRingTouch.h>
19 #include <geos/operation/valid/PolygonRingSelfNode.h>
21 #include <geos/export.h>
38 using geos::geom::CoordinateXY;
42 class GEOS_DLL PolygonRing {
47 PolygonRing* shell =
nullptr;
48 const LinearRing* ring =
nullptr;
54 PolygonRing* touchSetRoot =
nullptr;
68 std::map<int, PolygonRingTouch> touches;
74 std::vector<PolygonRingSelfNode> selfNodes;
86 bool isOnlyTouch(
const PolygonRing* polyRing,
const CoordinateXY& pt)
const;
96 const CoordinateXY* findHoleCycleLocation();
98 void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
108 const CoordinateXY* scanForHoleCycle(PolygonRingTouch* currentTouch,
110 std::stack<PolygonRingTouch*>& touchStack);
113 bool isInTouchSet()
const
115 return touchSetRoot !=
nullptr;
118 void setTouchSetRoot(PolygonRing* polyRing)
120 touchSetRoot = polyRing;
123 PolygonRing* getTouchSetRoot()
const
128 bool hasTouches()
const
130 return ! touches.empty();
133 std::vector<PolygonRingTouch*> getTouches()
const;
135 void addTouch(PolygonRing* polyRing,
const CoordinateXY& pt);
146 PolygonRing(
const LinearRing* p_ring,
int p_index, PolygonRing* p_shell)
156 PolygonRing(
const LinearRing* p_ring)
157 : PolygonRing(p_ring, -1, this)
166 static bool isShell(
const PolygonRing* polyRing);
177 static bool addTouch(PolygonRing* ring0, PolygonRing* ring1,
const CoordinateXY& pt);
188 static const CoordinateXY* findHoleCycleLocation(std::vector<PolygonRing*> polyRings);
199 static const CoordinateXY* findInteriorSelfNode(std::vector<PolygonRing*> polyRings);
201 bool isSamePolygon(
const PolygonRing* polyRing)
const
203 return shell == polyRing->shell;
208 return shell ==
this;
211 void addSelfTouch(
const CoordinateXY& origin,
212 const CoordinateXY* e00,
const CoordinateXY* e01,
213 const CoordinateXY* e10,
const CoordinateXY* e11);
221 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: Angle.h:25