GEOS 3.14.0dev
PolygonTriangulator.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <geos/triangulate/tri/TriList.h>
18#include <geos/triangulate/tri/Tri.h>
19
20// Forward declarations
21namespace geos {
22namespace geom {
23class Geometry;
24class GeometryFactory;
25class Polygon;
26}
27}
28
29namespace geos {
30namespace triangulate {
31namespace polygon {
32
33
52class GEOS_DLL PolygonTriangulator {
56 template<typename TriType>
59
60private:
61
62 // Members
63
64 const Geometry* inputGeom;
65 const GeometryFactory* geomFact;
66
67 std::unique_ptr<Geometry> compute();
68
74 void triangulatePolygon(const Polygon* poly, TriList<Tri>& triList);
75
76
77public:
78
84 PolygonTriangulator(const Geometry* p_inputGeom)
85 : inputGeom(p_inputGeom)
86 , geomFact(p_inputGeom->getFactory())
87 {}
88
95 static std::unique_ptr<Geometry> triangulate(const Geometry* geom);
96
97};
98
99
100
101} // namespace geos.triangulate.polygon
102} // namespace geos.triangulate
103} // namespace geos
104
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:197
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Definition PolygonTriangulator.h:52
static std::unique_ptr< Geometry > triangulate(const Geometry *geom)
PolygonTriangulator(const Geometry *p_inputGeom)
Definition PolygonTriangulator.h:84
Definition TriList.h:50
Definition Tri.h:45
Basic namespace for all GEOS functionalities.
Definition geos.h:39