00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef GEOS_SIMPLIFY_TAGGEDLINESSIMPLIFIER_H
00027 #define GEOS_SIMPLIFY_TAGGEDLINESSIMPLIFIER_H
00028
00029 #include <geos/export.h>
00030 #include <vector>
00031 #include <memory>
00032 #include <cassert>
00033
00034 #include <geos/simplify/LineSegmentIndex.h>
00035 #include <geos/simplify/TaggedLineStringSimplifier.h>
00036
00037 #ifdef _MSC_VER
00038 #pragma warning(push)
00039 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00040 #endif
00041
00042
00043 namespace geos {
00044 namespace simplify {
00045 class TaggedLineString;
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace simplify {
00051
00056 class GEOS_DLL TaggedLinesSimplifier {
00057
00058 public:
00059
00060 TaggedLinesSimplifier();
00061
00070 void setDistanceTolerance(double tolerance);
00071
00085 template <class iterator_type>
00086 void simplify(
00087 iterator_type begin,
00088 iterator_type end)
00089 {
00090
00091 for (iterator_type it=begin; it != end; ++it) {
00092 assert(*it);
00093 inputIndex->add(*(*it));
00094 }
00095
00096
00097 for (iterator_type it=begin; it != end; ++it) {
00098 assert(*it);
00099 simplify(*(*it));
00100 }
00101 }
00102
00103
00104 private:
00105
00106 void simplify(TaggedLineString& line);
00107
00108 std::auto_ptr<LineSegmentIndex> inputIndex;
00109
00110 std::auto_ptr<LineSegmentIndex> outputIndex;
00111
00112 std::auto_ptr<TaggedLineStringSimplifier> taggedlineSimplifier;
00113 };
00114
00115 }
00116 }
00117
00118 #ifdef _MSC_VER
00119 #pragma warning(pop)
00120 #endif
00121
00122 #endif // GEOS_SIMPLIFY_TAGGEDLINESSIMPLIFIER_H