GEOS  3.9.1dev
DelaunayTriangulationBuilder.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2012 Excensus LLC.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: triangulate/DelaunayTriangulationBuilder.java r524
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
20 #define GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
21 
24 
25 #include <memory>
26 
27 namespace geos {
28 namespace geom {
29 class Geometry;
30 class MultiLineString;
31 class GeometryCollection;
32 class GeometryFactory;
33 class Envelope;
34 }
35 namespace triangulate {
36 namespace quadedge {
37 class QuadEdgeSubdivision;
38 }
39 }
40 }
41 
42 namespace geos {
43 namespace triangulate { //geos.triangulate
44 
45 
56 public:
64  static std::unique_ptr<geom::CoordinateSequence> extractUniqueCoordinates(const geom::Geometry& geom);
65 
74 
80  static std::unique_ptr<geom::CoordinateSequence> unique(const geom::CoordinateSequence* seq);
81 
82 private:
83  std::unique_ptr<geom::CoordinateSequence> siteCoords;
84  double tolerance;
85  std::unique_ptr<quadedge::QuadEdgeSubdivision> subdiv;
86 
87 public:
93 
94  ~DelaunayTriangulationBuilder() = default;
95 
102  void setSites(const geom::Geometry& geom);
103 
110  void setSites(const geom::CoordinateSequence& coords);
111 
119  inline void
120  setTolerance(double p_tolerance)
121  {
122  this->tolerance = p_tolerance;
123  }
124 
125 private:
126  void create();
127 
128 public:
134  quadedge::QuadEdgeSubdivision& getSubdivision();
135 
142  std::unique_ptr<geom::MultiLineString> getEdges(const geom::GeometryFactory& geomFact);
143 
151  std::unique_ptr<geom::GeometryCollection> getTriangles(const geom::GeometryFactory& geomFact);
152 
161  static geom::Envelope envelope(const geom::CoordinateSequence& coords);
162 
163 };
164 
165 } //namespace geos.triangulate
166 } //namespace goes
167 
168 #endif //GEOS_TRIANGULATE_QUADEDGE_DELAUNAYTRIANGULATIONBUILDER_H
169 
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
#define GEOS_DLL
Definition: export.h:28
std::unique_ptr< geom::CoordinateSequence > siteCoords
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
A utility class which creates Delaunay Triangulations from collections of points and extract the resu...
std::unique_ptr< quadedge::QuadEdgeSubdivision > subdiv
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
A class that contains the QuadEdges representing a planar subdivision that models a triangulation...
Basic namespace for all GEOS functionalities.
The internal representation of a list of coordinates inside a Geometry.