GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
54 class GEOS_DLL DelaunayTriangulationBuilder
55 {
56 public:
62 static geom::CoordinateSequence* extractUniqueCoordinates(const geom::Geometry& geom);
63
64 static void unique(geom::CoordinateSequence& coords);
65
71 static IncrementalDelaunayTriangulator::VertexList* toVertices(const geom::CoordinateSequence &coords);
72
73 private:
74 geom::CoordinateSequence* siteCoords;
75 double tolerance;
76 quadedge::QuadEdgeSubdivision *subdiv;
77
78 public:
83 DelaunayTriangulationBuilder();
84
85 ~DelaunayTriangulationBuilder();
86
93 void setSites(const geom::Geometry& geom);
94
101 void setSites(const geom::CoordinateSequence& coords);
102
110 inline void setTolerance(double tolerance)
111 {
112 this->tolerance = tolerance;
113 }
114
115 private:
116 void create();
117
118 public:
124 quadedge::QuadEdgeSubdivision& getSubdivision();
125
132 std::auto_ptr<geom::MultiLineString> getEdges(const geom::GeometryFactory &geomFact);
133
141 std::auto_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