GEOS  3.10.0
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 
18 // Forward declarations
19 namespace geos {
20 namespace geom {
21 class Geometry;
22 class GeometryFactory;
23 class Polygon;
24 }
25 namespace triangulate {
26 namespace tri {
27 class TriList;
28 }
29 }
30 }
31 
36 
37 
38 namespace geos {
39 namespace triangulate {
40 namespace polygon {
41 
42 
61 class GEOS_DLL PolygonTriangulator {
62 
63 private:
64 
65  // Members
66 
67  const Geometry* inputGeom;
68  const GeometryFactory* geomFact;
69 
70  std::unique_ptr<Geometry> compute();
71 
77  void triangulatePolygon(const Polygon* poly, TriList& triList);
78 
79 
80 public:
81 
87  PolygonTriangulator(const Geometry* p_inputGeom)
88  : inputGeom(p_inputGeom)
89  , geomFact(p_inputGeom->getFactory())
90  {}
91 
98  static std::unique_ptr<Geometry> triangulate(const Geometry* geom);
99 
100 };
101 
102 
103 
104 } // namespace geos.triangulate.polygon
105 } // namespace geos.triangulate
106 } // namespace geos
107 
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
Definition: PolygonTriangulator.h:61
static std::unique_ptr< Geometry > triangulate(const Geometry *geom)
PolygonTriangulator(const Geometry *p_inputGeom)
Definition: PolygonTriangulator.h:87
Definition: TriList.h:48
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26