21 #ifndef GEOS_OP_POLYGONIZE_EDGERING_H
22 #define GEOS_OP_POLYGONIZE_EDGERING_H
24 #include <geos/export.h>
25 #include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
26 #include <geos/operation/polygonize/PolygonizeDirectedEdge.h>
27 #include <geos/geom/Geometry.h>
28 #include <geos/geom/LinearRing.h>
29 #include <geos/geom/Polygon.h>
33 #include <geos/geom/Location.h>
37 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
44 class CoordinateSequence;
45 class GeometryFactory;
48 namespace planargraph {
60 namespace polygonize {
70 typedef std::vector<const PolygonizeDirectedEdge*> DeList;
74 std::unique_ptr<geom::LinearRing> ring;
75 std::unique_ptr<geom::CoordinateArraySequence> ringPts;
76 std::unique_ptr<algorithm::locate::PointOnGeometryLocator> ringLocator;
78 std::unique_ptr<std::vector<std::unique_ptr<geom::LinearRing>>> holes;
82 bool is_processed =
false;
83 bool is_included_set =
false;
84 bool is_included =
false;
85 bool visitedByUpdateIncludedRecursive =
false;
100 if (ringLocator ==
nullptr) {
103 return ringLocator.get();
193 bool isIncludedSet()
const {
194 return is_included_set;
200 bool isIncluded()
const {
204 void setIncluded(
bool included) {
205 is_included = included;
206 is_included_set =
true;
209 bool isProcessed()
const {
213 void setProcessed(
bool processed) {
214 is_processed = processed;
232 return shell !=
nullptr;
242 return isHole() ? shell :
this;
265 return getOuterHole() !=
nullptr;
351 #endif // GEOS_OP_POLYGONIZE_EDGERING_H
void add(const PolygonizeDirectedEdge *de)
Adds a DirectedEdge which is known to form part of this ring.
bool isOuterHole() const
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by any shell...
Definition: operation/polygonize/EdgeRing.h:251
EdgeRing * findEdgeRingContaining(const std::vector< EdgeRing * > &erList)
Find the innermost enclosing shell EdgeRing containing this, if any.
void addHole(geom::LinearRing *hole)
Adds a hole to the polygon formed by this ring.
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: IndexedNestedRingTester.h:26
static std::vector< PolygonizeDirectedEdge * > findDirEdgesInRing(PolygonizeDirectedEdge *startDE)
Traverses a ring of DirectedEdges, accumulating them into a list.
static bool isInList(const geom::Coordinate &pt, const geom::CoordinateSequence *pts)
Tests whether a given point is in an array of points. Uses a value-based test.
std::unique_ptr< geom::Polygon > getPolygon()
Computes the Polygon formed by this ring and any contained holes.
void updateIncludedRecursive()
Updates the included status for currently non-included shells based on whether they are adjacent to a...
geom::LinearRing * getRingInternal()
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topolo...
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
A DirectedEdge of a PolygonizeGraph, which represents an edge of a polygon formed by the graph.
Definition: PolygonizeDirectedEdge.h:54
bool isOuterShell() const
Tests whether this ring is an outer shell.
Definition: operation/polygonize/EdgeRing.h:264
static const geom::Coordinate & ptNotInList(const geom::CoordinateSequence *testPts, const geom::CoordinateSequence *pts)
Finds a point in a list of points which is not contained in another list of points.
Represents a ring of PolygonizeDirectedEdge which form a ring of a polygon. The ring may be either an...
Definition: operation/polygonize/EdgeRing.h:66
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
bool hasShell() const
Tests whether this ring has a shell assigned to it.
Definition: operation/polygonize/EdgeRing.h:231
EdgeRing * getOuterHole() const
Gets the outer hole of a shell, if it has one. An outer hole is one that is not contained in any othe...
std::unique_ptr< geom::LinearRing > getRingOwnership()
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topolo...
bool isHole() const
Tests whether this ring is a hole.
Definition: operation/polygonize/EdgeRing.h:186
EdgeRing * getShell()
Gets the shell for this ring. The shell is the ring itself if it is not a hole, otherwise it is the p...
Definition: operation/polygonize/EdgeRing.h:241
bool isValid()
Tests if the LinearRing ring formed by this edge ring is topologically valid.
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition: IndexedPointInAreaLocator.h:55
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:37
The default implementation of CoordinateSequence.
Definition: CoordinateArraySequence.h:37
std::unique_ptr< geom::LineString > getLineString()
Gets the coordinates for this ring as a LineString.
void setShell(EdgeRing *shellRing)
Sets the containing shell ring of a ring that has been determined to be a hole.
Definition: operation/polygonize/EdgeRing.h:222