PolygonTriangulator.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 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/triangulate/tri/TriList.h>
#include <geos/triangulate/tri/Tri.h>
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class GeometryFactory;
class Polygon;
}
}
namespace geos {
namespace triangulate {
namespace polygon {
class GEOS_DLL PolygonTriangulator {
using Geometry = geos::geom::Geometry;
using GeometryFactory = geos::geom::GeometryFactory;
using Polygon = geos::geom::Polygon;
template<typename TriType>
using TriList = geos::triangulate::tri::TriList<TriType>;
using Tri = geos::triangulate::tri::Tri;
private:
// Members
const Geometry* inputGeom;
const GeometryFactory* geomFact;
std::unique_ptr<Geometry> compute();
void triangulatePolygon(const Polygon* poly, TriList<Tri>& triList);
public:
PolygonTriangulator(const Geometry* p_inputGeom)
: inputGeom(p_inputGeom)
, geomFact(p_inputGeom->getFactory())
{}
static std::unique_ptr<Geometry> triangulate(const Geometry* geom);
};
} // namespace geos.triangulate.polygon
} // namespace geos.triangulate
} // namespace geos
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::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::triangulate::polygon::PolygonTriangulator::triangulate
static std::unique_ptr< Geometry > triangulate(const Geometry *geom)
geos::triangulate::polygon::PolygonTriangulator::PolygonTriangulator
PolygonTriangulator(const Geometry *p_inputGeom)
Definition PolygonTriangulator.h:84
geos::triangulate::tri::TriList
Definition TriList.h:50
geos::triangulate::tri::Tri
Definition Tri.h:45
geos::geom
Definition Angle.h:26
geos::triangulate
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38