GEOS: VoronoiDiagramBuilder.h Source File

GEOS 3.5.0

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

- File List

VoronoiDiagramBuilder.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/VoronoiDiagramBuilder.java r524
16 *
17 **********************************************************************/
18
19 #ifndef GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H
20 #define GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H
21
22 #include <geos/triangulate/quadedge/QuadEdgeSubdivision.h>
23 #include <geos/geom/Envelope.h> // for composition
24 #include <memory>
25 #include <iostream>
26
27 namespace geos {
28 namespace geom{
29 class Geometry;
30 class CoordinateSequence;
31 class GeometryCollection;
32 class GeometryFactory;
33 }
34 namespace triangulate { //geos.triangulate
35
46 class GEOS_DLL VoronoiDiagramBuilder{
47 public:
52 VoronoiDiagramBuilder();
53
54 ~VoronoiDiagramBuilder();
55
62 void setSites(const geom::Geometry& geom);
63
70 void setSites(const geom::CoordinateSequence& coords);
71
81 void setClipEnvelope(const geom::Envelope* clipEnv);
82
90 void setTolerance(double tolerance);
91
97 std::auto_ptr<quadedge::QuadEdgeSubdivision> getSubdivision();
98
106 std::auto_ptr<geom::GeometryCollection> getDiagram(const geom::GeometryFactory& geomFact);
107
115 std::auto_ptr<geom::Geometry> getDiagramEdges(const geom::GeometryFactory& geomFact);
116
117 private:
118
119 std::auto_ptr<geom::CoordinateSequence> siteCoords;
120 double tolerance;
121 std::auto_ptr<quadedge::QuadEdgeSubdivision> subdiv;
122 const geom::Envelope* clipEnv; // externally owned
123 geom::Envelope diagramEnv;
124
125 void create();
126
127 static std::auto_ptr<geom::GeometryCollection>
128 clipGeometryCollection(const geom::GeometryCollection& geom, const geom::Envelope& clipEnv);
129
130 };
131
132 } //namespace geos.triangulate
133 } //namespace geos
134
135 #endif //GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:53
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
geos::geom::GeometryCollection
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:56
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::triangulate::VoronoiDiagramBuilder
Definition: VoronoiDiagramBuilder.h:46
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59