GEOS  3.14.0dev
DelaunayTriangulationBuilder.h
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 #pragma once
20 
21 #include <geos/triangulate/IncrementalDelaunayTriangulator.h>
22 #include <geos/geom/CoordinateSequence.h>
23 
24 #include <memory>
25 
26 namespace geos {
27 namespace geom {
28 class Geometry;
29 class MultiLineString;
30 class GeometryCollection;
31 class GeometryFactory;
32 class Envelope;
33 }
34 namespace triangulate {
35 namespace quadedge {
36 class QuadEdgeSubdivision;
37 }
38 }
39 }
40 
41 namespace geos {
42 namespace triangulate { //geos.triangulate
43 
44 
55 public:
63  static std::unique_ptr<geom::CoordinateSequence> extractUniqueCoordinates(const geom::Geometry& geom);
64 
72  static IncrementalDelaunayTriangulator::VertexList toVertices(const geom::CoordinateSequence& coords);
73 
79  static std::unique_ptr<geom::CoordinateSequence> unique(const geom::CoordinateSequence* seq);
80 
81 private:
82  std::unique_ptr<geom::CoordinateSequence> siteCoords;
83  double tolerance;
84  std::unique_ptr<quadedge::QuadEdgeSubdivision> subdiv;
85 
86 public:
92 
93  ~DelaunayTriangulationBuilder() = default;
94 
101  void setSites(const geom::Geometry& geom);
102 
109  void setSites(const geom::CoordinateSequence& coords);
110 
118  inline void
119  setTolerance(double p_tolerance)
120  {
121  this->tolerance = p_tolerance;
122  }
123 
124 private:
125  void create();
126 
127 public:
134 
141  std::unique_ptr<geom::MultiLineString> getEdges(const geom::GeometryFactory& geomFact);
142 
150  std::unique_ptr<geom::GeometryCollection> getTriangles(const geom::GeometryFactory& geomFact);
151 
161 
162 };
163 
164 } //namespace geos.triangulate
165 } //namespace goes
166 
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
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
A utility class which creates Delaunay Triangulations from collections of points and extract the resu...
Definition: DelaunayTriangulationBuilder.h:54
static std::unique_ptr< geom::CoordinateSequence > extractUniqueCoordinates(const geom::Geometry &geom)
std::unique_ptr< geom::GeometryCollection > getTriangles(const geom::GeometryFactory &geomFact)
quadedge::QuadEdgeSubdivision & getSubdivision()
static IncrementalDelaunayTriangulator::VertexList toVertices(const geom::CoordinateSequence &coords)
void setSites(const geom::CoordinateSequence &coords)
static std::unique_ptr< geom::CoordinateSequence > unique(const geom::CoordinateSequence *seq)
static geom::Envelope envelope(const geom::CoordinateSequence &coords)
void setSites(const geom::Geometry &geom)
std::unique_ptr< geom::MultiLineString > getEdges(const geom::GeometryFactory &geomFact)
void setTolerance(double p_tolerance)
Definition: DelaunayTriangulationBuilder.h:119
A class that contains the QuadEdges representing a planar subdivision that models a triangulation.
Definition: QuadEdgeSubdivision.h:78
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25