00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
00020 #define GEOS_TRIANGULATE_DELAUNAYTRIANGULATIONBUILDER_H
00021
00022 #include <geos/triangulate/IncrementalDelaunayTriangulator.h>
00023
00024
00025 namespace geos {
00026 namespace geom{
00027 class CoordinateSequence;
00028 class Geometry;
00029 class MultiLineString;
00030 class GeometryCollection;
00031 class GeometryFactory;
00032 class Envelope;
00033 }
00034 namespace triangulate {
00035 namespace quadedge {
00036 class QuadEdgeSubdivision;
00037 }
00038 }
00039 }
00040
00041 namespace geos {
00042 namespace triangulate {
00043
00044
00054 class GEOS_DLL DelaunayTriangulationBuilder
00055 {
00056 public:
00062 static geom::CoordinateSequence* extractUniqueCoordinates(const geom::Geometry& geom);
00063
00064 static void unique(geom::CoordinateSequence& coords);
00065
00071 static IncrementalDelaunayTriangulator::VertexList* toVertices(const geom::CoordinateSequence &coords);
00072
00073 private:
00074 geom::CoordinateSequence* siteCoords;
00075 double tolerance;
00076 quadedge::QuadEdgeSubdivision *subdiv;
00077
00078 public:
00083 DelaunayTriangulationBuilder();
00084
00085 ~DelaunayTriangulationBuilder();
00086
00093 void setSites(const geom::Geometry& geom);
00094
00101 void setSites(const geom::CoordinateSequence& coords);
00102
00110 inline void setTolerance(double tolerance)
00111 {
00112 this->tolerance = tolerance;
00113 }
00114
00115 private:
00116 void create();
00117
00118 public:
00124 quadedge::QuadEdgeSubdivision& getSubdivision();
00125
00132 std::auto_ptr<geom::MultiLineString> getEdges(const geom::GeometryFactory &geomFact);
00133
00141 std::auto_ptr<geom::GeometryCollection> getTriangles(const geom::GeometryFactory& geomFact);
00142
00150 static geom::Envelope envelope(const geom::CoordinateSequence& coords);
00151
00152 };
00153
00154 }
00155 }
00156
00157 #endif //GEOS_TRIANGULATE_QUADEDGE_DELAUNAYTRIANGULATIONBUILDER_H
00158