17#include <geos/geom/Coordinate.h>
18#include <geos/geom/CoordinateSequence.h>
19#include <geos/algorithm/LineIntersector.h>
20#include <geos/noding/SegmentIntersector.h>
21#include <geos/noding/BasicSegmentString.h>
22#include <geos/noding/SegmentSetMutualIntersector.h>
47namespace triangulate {
74 static constexpr std::size_t NO_INDEX = std::numeric_limits<std::size_t>::max();
79 std::unique_ptr<CoordinateSequence> shellRing;
80 std::vector<std::unique_ptr<CoordinateSequence>> holeRings;
83 std::vector<bool> isHoleTouchingHint;
85 std::vector<Coordinate> joinedRing;
88 std::set<Coordinate> joinedPts;
90 std::unique_ptr<SegmentSetMutualIntersector> boundaryIntersector;
93 std::vector<std::unique_ptr<BasicSegmentString>> polySegStringStore;
97 class InteriorIntersectionDetector;
98 friend class PolygonHoleJoiner::InteriorIntersectionDetector;
101 void extractOrientedRings(
const Polygon* polygon);
102 static std::unique_ptr<CoordinateSequence> extractOrientedRing(
const LinearRing* ring,
bool isCW);
133 void joinNonTouchingHole(
149 std::size_t findJoinIndex(
162 static bool isLineInterior(
163 const std::vector<Coordinate>& ring,
164 std::size_t ringIndex,
167 static std::size_t prev(std::size_t i, std::size_t size);
168 static std::size_t next(std::size_t i, std::size_t size);
183 std::size_t joinIndex,
185 std::size_t holeJoinIndex);
197 std::vector<Coordinate> createHoleSection(
199 std::size_t holeJoinIndex,
208 static std::vector<const LinearRing*> sortHoles(
211 static std::size_t findLowestLeftVertexIndex(
222 bool intersectsBoundary(
226 std::unique_ptr<SegmentSetMutualIntersector> createBoundaryIntersector();
232 : inputPolygon(p_inputPolygon)
233 , boundaryIntersector(
nullptr)
244 const Polygon* p_inputPolygon);
253 static std::unique_ptr<CoordinateSequence>
join(
254 const Polygon* p_inputPolygon);
261 std::unique_ptr<CoordinateSequence>
compute();
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
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
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Represents a list of contiguous line segments, and supports noding the segments.
Definition: BasicSegmentString.h:44
An intersector for the red-blue intersection problem.
Definition: SegmentSetMutualIntersector.h:36
Definition: PolygonHoleJoiner.h:68
static std::unique_ptr< CoordinateSequence > join(const Polygon *p_inputPolygon)
static std::unique_ptr< Polygon > joinAsPolygon(const Polygon *p_inputPolygon)
std::unique_ptr< CoordinateSequence > compute()
Basic namespace for all GEOS functionalities.
Definition: geos.h:39