HullTriangulation.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/algorithm/hull/HullTri.h>
#include <geos/triangulate/tri/TriList.h>
#include <geos/triangulate/quadedge/TriangleVisitor.h>
namespace geos {
namespace geom {
class Geometry;
class GeometryFactory;
class Coordinate;
}
namespace triangulate {
namespace quadedge {
class QuadEdge;
class QuadEdgeSubdivision;
}
}
}
namespace geos {
namespace algorithm { // geos::algorithm
namespace hull { // geos::algorithm::hull
class HullTriangulation
{
using Geometry = geos::geom::Geometry;
using GeometryFactory = geos::geom::GeometryFactory;
using Coordinate = geos::geom::Coordinate;
template<typename TriType>
using TriList = geos::triangulate::tri::TriList<TriType>;
using QuadEdge = geos::triangulate::quadedge::QuadEdge;
using QuadEdgeSubdivision = geos::triangulate::quadedge::QuadEdgeSubdivision;
using TriangleVisitor = geos::triangulate::quadedge::TriangleVisitor;
private:
static void toTris(
QuadEdgeSubdivision& subdiv,
TriList<HullTri>& triList);
static geom::CoordinateSequence traceBoundary(
TriList<HullTri>& triList);
static HullTri* findBorderTri(
TriList<HullTri>& triList);
public:
HullTriangulation() {};
static void createDelaunayTriangulation(
const Geometry* geom,
TriList<HullTri>& triList);
static std::unique_ptr<Geometry> traceBoundaryPolygon(
TriList<HullTri>& triList,
const GeometryFactory* factory);
static HullTri* nextBorderTri(HullTri* triStart);
static std::unique_ptr<Geometry> geomunion(
TriList<HullTri>& triList,
const GeometryFactory* factory);
class HullTriVisitor : public TriangleVisitor
{
private:
TriList<HullTri>& triList;
public:
HullTriVisitor(TriList<HullTri>& p_triList)
: triList(p_triList)
{};
void visit(std::array<QuadEdge*, 3>& triEdges) override;
}; // HullTriVisitor
}; // HullTriangulation
} // geos::algorithm::hull
} // geos::algorithm
} // geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::triangulate::quadedge::QuadEdgeSubdivision
A class that contains the QuadEdges representing a planar subdivision that models a triangulation.
Definition QuadEdgeSubdivision.h:78
geos::triangulate::quadedge::QuadEdge
A class that represents the edge data structure which implements the quadedge algebra.
Definition QuadEdge.h:53
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom
Definition Angle.h:26
geos::triangulate::quadedge
Classes to implement a topological subdivision of quadeges, to support creating triangulations and Vo...
Definition ConcaveHull.h:33
geos::triangulate
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38