00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00021 #define GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00022
00023 #include <geos/export.h>
00024 #include <vector>
00025 #include <memory>
00026
00027 #ifdef _MSC_VER
00028 #pragma warning(push)
00029 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00030 #endif
00031
00032
00033 namespace geos {
00034 namespace geom {
00035 class Coordinate;
00036 }
00037 }
00038
00039 namespace geos {
00040 namespace simplify {
00041
00046 class GEOS_DLL DouglasPeuckerLineSimplifier {
00047
00048 public:
00049
00050 typedef std::vector<short int> BoolVect;
00051 typedef std::auto_ptr<BoolVect> BoolVectAutoPtr;
00052
00053 typedef std::vector<geom::Coordinate> CoordsVect;
00054 typedef std::auto_ptr<CoordsVect> CoordsVectAutoPtr;
00055
00056
00061 static CoordsVectAutoPtr simplify(
00062 const CoordsVect& nPts,
00063 double distanceTolerance);
00064
00065 DouglasPeuckerLineSimplifier(const CoordsVect& nPts);
00066
00075 void setDistanceTolerance(double nDistanceTolerance);
00076
00081 CoordsVectAutoPtr simplify();
00082
00083 private:
00084
00085 const CoordsVect& pts;
00086 BoolVectAutoPtr usePt;
00087 double distanceTolerance;
00088
00089 void simplifySection(std::size_t i, std::size_t j);
00090
00091
00092 DouglasPeuckerLineSimplifier(const DouglasPeuckerLineSimplifier& other);
00093 DouglasPeuckerLineSimplifier& operator=(const DouglasPeuckerLineSimplifier& rhs);
00094 };
00095
00096 }
00097 }
00098
00099 #ifdef _MSC_VER
00100 #pragma warning(pop)
00101 #endif
00102
00103 #endif // GEOS_SIMPLIFY_DOUBGLASPEUCKERLINESIMPLIFIER_H
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119