22#include <geos/export.h>
23#include <geos/algorithm/locate/PointOnGeometryLocator.h>
24#include <geos/operation/polygonize/PolygonizeDirectedEdge.h>
25#include <geos/geom/Geometry.h>
26#include <geos/geom/LinearRing.h>
27#include <geos/geom/Polygon.h>
31#include <geos/geom/Location.h>
35#pragma warning(disable: 4251)
43class CoordinateSequence;
47namespace planargraph {
64 typedef std::vector<const PolygonizeDirectedEdge*> DeList;
68 mutable std::unique_ptr<geom::Curve> ring;
69 mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> ringLocator;
71 std::vector<std::unique_ptr<geom::Curve>> holes;
75 bool is_valid =
false;
76 bool is_processed =
false;
77 bool is_included_set =
false;
78 bool is_included =
false;
79 bool visitedByUpdateIncludedRecursive =
false;
82 return *getRingInternal()->getEnvelopeInternal();
87 bool contains(
const EdgeRing& otherRing)
const;
88 bool isPointInOrOut(
const EdgeRing& otherRing)
const;
163 const DeList& getEdges()
const {
181 bool isIncludedSet()
const {
182 return is_included_set;
188 bool isIncluded()
const {
192 void setIncluded(
bool included) {
193 is_included = included;
194 is_included_set =
true;
197 bool isProcessed()
const {
201 void setProcessed(
bool processed) {
202 is_processed = processed;
220 return shell !=
nullptr;
230 return isHole() ? shell :
this;
253 return getOuterHole() !=
nullptr;
278 void addHole(std::unique_ptr<geom::Curve> hole);
317 return getLocator()->
locate(&pt);
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
virtual geom::Location locate(const geom::CoordinateXY *p)=0
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:72
Represents a ring of PolygonizeDirectedEdge which form a ring of a polygon. The ring may be either an...
Definition operation/polygonize/EdgeRing.h:60
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:210
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::Surface > getPolygon()
Computes the Polygon formed by this ring and any contained holes.
std::unique_ptr< geom::Curve > getRingOwnership()
Returns this ring or null if an Exception occurs while creating it (such as a topology problem).
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:239
void addHole(std::unique_ptr< geom::Curve > hole)
Adds a hole to the polygon formed by this ring.
bool isOuterShell() const
Tests whether this ring is an outer shell.
Definition operation/polygonize/EdgeRing.h:252
const geom::Curve * getRingInternal() const
Returns this ring or null if an Exception occurs while creating it (such as a topology problem).
EdgeRing * findEdgeRingContaining(const std::vector< EdgeRing * > &erList) const
Find the innermost enclosing shell EdgeRing containing this, if any.
bool isHole() const
Tests whether this ring is a hole.
Definition operation/polygonize/EdgeRing.h:174
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:229
bool isValid() const
Tests if the LinearRing ring formed by this edge ring is topologically valid.
void updateIncludedRecursive()
Updates the included status for currently non-included shells based on whether they are adjacent to a...
static bool isInList(const geom::CoordinateXY &pt, const geom::CoordinateSequence *pts)
Tests whether a given point is in an array of points. Uses a value-based test.
bool hasShell() const
Tests whether this ring has a shell assigned to it.
Definition operation/polygonize/EdgeRing.h:219
static const geom::CoordinateXY & 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.
static std::vector< PolygonizeDirectedEdge * > findDirEdgesInRing(PolygonizeDirectedEdge *startDE)
Traverses a ring of DirectedEdges, accumulating them into a list.
void add(const PolygonizeDirectedEdge *de)
Adds a DirectedEdge which is known to form part of this ring.
A DirectedEdge of a PolygonizeGraph, which represents an edge of a polygon formed by the graph.
Definition PolygonizeDirectedEdge.h:52
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:38