00001 /********************************************************************** 00002 * $Id: DouglasPeuckerSimplifier.h 2785 2009-12-03 19:55:11Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 ********************************************************************** 00015 * 00016 * Last port: simplify/DouglasPeuckerSimplifier.java rev. 1.5 (JTS-1.7) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_SIMPLIFY_DOUBGLASPEUCKERSIMPLIFIER_H 00021 #define GEOS_SIMPLIFY_DOUBGLASPEUCKERSIMPLIFIER_H 00022 00023 #include <geos/export.h> 00024 #include <memory> // for auto_ptr 00025 00026 // Forward declarations 00027 namespace geos { 00028 namespace geom { 00029 class Geometry; 00030 } 00031 } 00032 00033 namespace geos { 00034 namespace simplify { // geos::simplify 00035 00036 00051 class GEOS_DLL DouglasPeuckerSimplifier { 00052 00053 public: 00054 00055 static std::auto_ptr<geom::Geometry> simplify( 00056 const geom::Geometry* geom, 00057 double tolerance); 00058 00059 DouglasPeuckerSimplifier(const geom::Geometry* geom); 00060 00071 void setDistanceTolerance(double tolerance); 00072 00073 std::auto_ptr<geom::Geometry> getResultGeometry(); 00074 00075 00076 private: 00077 00078 const geom::Geometry* inputGeom; 00079 00080 double distanceTolerance; 00081 }; 00082 00083 00084 } // namespace geos::simplify 00085 } // namespace geos 00086 00087 #endif // GEOS_SIMPLIFY_DOUBGLASPEUCKERSIMPLIFIER_H 00088 00089 /********************************************************************** 00090 * $Log$ 00091 * Revision 1.2 2006/04/13 10:39:12 strk 00092 * Initial implementation of TaggedLinesSimplifier class 00093 * 00094 * Revision 1.1 2006/04/11 16:04:34 strk 00095 * geos::simplify::DouglasPeukerSimplifier class + unit test 00096 * 00097 **********************************************************************/