GEOS  3.8.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 #ifndef GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
20 #define GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
21 
22 #include <geos/triangulate/IncrementalDelaunayTriangulator.h>
23 
24 
25 namespace geos {
26 namespace geom {
27 class CoordinateSequence;
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:
61  static geom::CoordinateSequence* extractUniqueCoordinates(const geom::Geometry& geom);
62 
63  static void unique(geom::CoordinateSequence& coords);
64 
70  static IncrementalDelaunayTriangulator::VertexList* toVertices(const geom::CoordinateSequence& coords);
71 
72 private:
73  geom::CoordinateSequence* siteCoords;
74  double tolerance;
76 
77 public:
83 
85 
92  void setSites(const geom::Geometry& geom);
93 
100  void setSites(const geom::CoordinateSequence& coords);
101 
109  inline void
110  setTolerance(double p_tolerance)
111  {
112  this->tolerance = p_tolerance;
113  }
114 
115 private:
116  void create();
117 
118 public:
124  quadedge::QuadEdgeSubdivision& getSubdivision();
125 
132  std::unique_ptr<geom::MultiLineString> getEdges(const geom::GeometryFactory& geomFact);
133 
141  std::unique_ptr<geom::GeometryCollection> getTriangles(const geom::GeometryFactory& geomFact);
142 
150  static geom::Envelope envelope(const geom::CoordinateSequence& coords);
151 
152 };
153 
154 } //namespace geos.triangulate
155 } //namespace goes
156 
157 #endif //GEOS_TRIANGULATE_QUADEDGE_DELAUNAYTRIANGULATIONBUILDER_H
158 
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
Definition: DelaunayTriangulationBuilder.h:54
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
Definition: QuadEdgeSubdivision.h:79
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
void setTolerance(double p_tolerance)
Definition: DelaunayTriangulationBuilder.h:110