VoronoiDiagramBuilder.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2012 Excensus LLC.
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************
00014  *
00015  * Last port: triangulate/VoronoiDiagramBuilder.java r524
00016  *
00017  **********************************************************************/
00018 
00019 #ifndef GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H
00020 #define GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H
00021 
00022 #include <geos/triangulate/quadedge/QuadEdgeSubdivision.h>
00023 #include <geos/geom/Envelope.h> // for composition 
00024 #include <memory>
00025 #include <iostream>
00026 
00027 namespace geos {
00028   namespace geom{
00029         class Geometry;
00030         class CoordinateSequence;
00031         class GeometryCollection;
00032         class GeometryFactory;
00033 }
00034 namespace triangulate { //geos.triangulate
00035 
00046 class GEOS_DLL VoronoiDiagramBuilder{
00047 public:
00052         VoronoiDiagramBuilder();
00053         
00054         ~VoronoiDiagramBuilder();
00055         
00062         void setSites(const geom::Geometry& geom);
00063         
00070         void setSites(const geom::CoordinateSequence& coords);
00071         
00081         void setClipEnvelope(const geom::Envelope* clipEnv);
00082         
00090         void setTolerance(double tolerance);
00091         
00097         std::auto_ptr<quadedge::QuadEdgeSubdivision> getSubdivision();
00098 
00106         std::auto_ptr<geom::GeometryCollection> getDiagram(const geom::GeometryFactory& geomFact);
00107 
00115         std::auto_ptr<geom::Geometry> getDiagramEdges(const geom::GeometryFactory& geomFact);
00116 
00117 private:
00118 
00119         std::auto_ptr<geom::CoordinateSequence> siteCoords;
00120         double tolerance;
00121         std::auto_ptr<quadedge::QuadEdgeSubdivision> subdiv;
00122         const geom::Envelope* clipEnv; // externally owned
00123         geom::Envelope diagramEnv;
00124 
00125         void create();
00126         
00127         static std::auto_ptr<geom::GeometryCollection> 
00128                 clipGeometryCollection(const geom::GeometryCollection& geom, const geom::Envelope& clipEnv);
00129 
00130 };
00131 
00132 } //namespace geos.triangulate
00133 } //namespace geos
00134 
00135 #endif //GEOS_TRIANGULATE_VORONOIDIAGRAMBUILDER_H

Generated on 30 Dec 2015 for GEOS by  doxygen 1.4.7