18#include <geos/operation/valid/PolygonRingTouch.h>
19#include <geos/operation/valid/PolygonRingSelfNode.h>
21#include <geos/export.h>
43class GEOS_DLL PolygonRing {
48 PolygonRing* shell =
nullptr;
49 const LinearRing* ring =
nullptr;
55 PolygonRing* touchSetRoot =
nullptr;
69 std::map<int, PolygonRingTouch> touches;
75 std::vector<PolygonRingSelfNode> selfNodes;
87 bool isOnlyTouch(
const PolygonRing* polyRing,
const Coordinate& pt)
const;
97 const Coordinate* findHoleCycleLocation();
99 void init(PolygonRing* root, std::stack<PolygonRingTouch*>& touchStack);
109 const Coordinate* scanForHoleCycle(PolygonRingTouch* currentTouch,
111 std::stack<PolygonRingTouch*>& touchStack);
114 bool isInTouchSet()
const
116 return touchSetRoot !=
nullptr;
119 void setTouchSetRoot(PolygonRing* polyRing)
121 touchSetRoot = polyRing;
124 PolygonRing* getTouchSetRoot()
const
129 bool hasTouches()
const
131 return ! touches.empty();
134 std::vector<PolygonRingTouch*> getTouches()
const;
136 void addTouch(PolygonRing* polyRing,
const Coordinate& pt);
147 PolygonRing(
const LinearRing* p_ring,
int p_index, PolygonRing* p_shell)
157 PolygonRing(
const LinearRing* p_ring)
158 : PolygonRing(p_ring, -1, this)
167 static bool isShell(
const PolygonRing* polyRing);
178 static bool addTouch(PolygonRing* ring0, PolygonRing* ring1,
const Coordinate& pt);
189 static const Coordinate* findHoleCycleLocation(std::vector<PolygonRing*> polyRings);
200 static const Coordinate* findInteriorSelfNode(std::vector<PolygonRing*> polyRings);
202 bool isSamePolygon(
const PolygonRing* polyRing)
const
204 return shell == polyRing->shell;
209 return shell ==
this;
212 void addSelfTouch(
const Coordinate& origin,
213 const Coordinate* e00,
const Coordinate* e01,
214 const Coordinate* e10,
const Coordinate* e11);
222 const Coordinate* findInteriorSelfNode();
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
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