17#include <geos/geom/Triangle.h>
18#include <geos/triangulate/tri/Tri.h>
19#include <geos/triangulate/tri/TriList.h>
20#include <geos/triangulate/quadedge/TriangleVisitor.h>
21#include <geos/algorithm/hull/HullTri.h>
45typedef std::priority_queue<HullTri*, std::vector<HullTri*>, HullTri::HullTriCompare> HullTriQueue;
85class GEOS_DLL ConcaveHull {
93 template<
typename TriType>
98 ConcaveHull(
const Geometry*
geom);
123 const Geometry*
geom,
double maxLength);
126 const Geometry*
geom,
double maxLength,
bool isHolesAllowed);
140 const Geometry*
geom,
double lengthRatio);
156 const Geometry*
geom,
158 bool isHolesAllowed);
170 const Geometry*
geom,
172 bool isHolesAllowed);
231 static constexpr int PARAM_EDGE_LENGTH = 1;
232 static constexpr int PARAM_ALPHA = 2;
235 const Geometry* inputGeometry;
236 double maxEdgeLengthRatio;
240 double maxSizeInHull;
241 const GeometryFactory* geomFactory;
244 static double computeTargetEdgeLength(
245 TriList<HullTri>& triList,
246 double edgeLengthFactor);
248 void computeHull(TriList<HullTri>& triList);
249 void computeHullBorder(TriList<HullTri>& triList);
250 void createBorderQueue(HullTriQueue& queue, TriList<HullTri>& triList);
262 void addBorderTri(HullTri* tri, HullTriQueue& queue);
263 void computeHullHoles(TriList<HullTri>& triList);
264 void setSize(HullTri* tri);
279 static std::vector<HullTri*> findCandidateHoles(
280 TriList<HullTri>& triList,
double maxSizeInHull);
282 void removeHole(TriList<HullTri>& triList, HullTri* triHole);
283 void setSize(TriList<HullTri>& triList);
292 bool isInHull(
const HullTri* tri)
const;
294 bool isRemovableBorder(
const HullTri* tri)
const;
295 bool isRemovableHole(
const HullTri* tri)
const;
297 std::unique_ptr<Geometry> toGeometry(
298 TriList<HullTri>& triList,
299 const GeometryFactory* factory);
static std::unique_ptr< Geometry > concaveHullByLengthRatio(const Geometry *geom, double lengthRatio, bool isHolesAllowed)
static std::unique_ptr< Geometry > concaveHullByLengthRatio(const Geometry *geom, double lengthRatio)
void setHolesAllowed(bool holesAllowed)
void setAlpha(double newAlpha)
static double uniformEdgeLength(const Geometry *geom)
static std::unique_ptr< Geometry > alphaShape(const Geometry *geom, double alpha, bool isHolesAllowed)
static std::unique_ptr< Geometry > concaveHullByLength(const Geometry *geom, double maxLength)
void setMaximumEdgeLength(double edgeLength)
void setMaximumEdgeLengthRatio(double edgeLengthRatio)
std::unique_ptr< Geometry > getHull()
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
Represents a planar triangle, and provides methods for calculating various properties of triangles.
Definition Triangle.h:28
A class that contains the QuadEdges representing a planar subdivision that models a triangulation.
Definition QuadEdgeSubdivision.h:78
A class that represents the edge data structure which implements the quadedge algebra.
Definition QuadEdge.h:53
Classes to implement a topological subdivision of quadeges, to support creating triangulations and Vo...
Definition ConcaveHull.h:33
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:38