00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GEOS_NODING_SCALEDNODER_H
00020 #define GEOS_NODING_SCALEDNODER_H
00021
00022 #include <geos/export.h>
00023
00024 #include <cassert>
00025 #include <vector>
00026
00027 #include <geos/inline.h>
00028 #include <geos/noding/Noder.h>
00029
00030 #include <geos/util.h>
00031
00032 #ifdef _MSC_VER
00033 #pragma warning(push)
00034 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00035 #endif
00036
00037
00038 namespace geos {
00039 namespace geom {
00040 class Coordinate;
00041 class CoordinateSequence;
00042 }
00043 namespace noding {
00044 class SegmentString;
00045 }
00046 }
00047
00048 namespace geos {
00049 namespace noding {
00050
00061 class GEOS_DLL ScaledNoder : public Noder {
00062
00063 public:
00064
00065 bool isIntegerPrecision() { return (scaleFactor == 1.0); }
00066
00067 ScaledNoder(Noder& n, double nScaleFactor,
00068 double nOffsetX=0.0, double nOffsetY=0.0)
00069 :
00070 noder(n),
00071 scaleFactor(nScaleFactor),
00072 offsetX(nOffsetX),
00073 offsetY(nOffsetY),
00074 isScaled(nScaleFactor!=1.0)
00075 {}
00076
00077 ~ScaledNoder();
00078
00079 std::vector<SegmentString*>* getNodedSubstrings() const;
00080
00081 void computeNodes(std::vector<SegmentString*>* inputSegStr);
00082
00083
00084
00085 void filter_ro(const geom::Coordinate* c)
00086 {
00087 ::geos::ignore_unused_variable_warning(c);
00088 assert(0);
00089 }
00090
00091 void filter_rw(geom::Coordinate* c) const;
00092
00093 private:
00094
00095 Noder& noder;
00096
00097 double scaleFactor;
00098
00099 double offsetX;
00100
00101 double offsetY;
00102
00103 bool isScaled;
00104
00105 void rescale(std::vector<SegmentString*>& segStrings) const;
00106
00107 void scale(std::vector<SegmentString*>& segStrings) const;
00108
00109 class Scaler;
00110
00111 class ReScaler;
00112
00113 friend class ScaledNoder::Scaler;
00114
00115 friend class ScaledNoder::ReScaler;
00116
00117 mutable std::vector<geom::CoordinateSequence*> newCoordSeq;
00118
00119
00120 ScaledNoder(const ScaledNoder& other);
00121 ScaledNoder& operator=(const ScaledNoder& rhs);
00122 };
00123
00124 }
00125 }
00126
00127 #ifdef _MSC_VER
00128 #pragma warning(pop)
00129 #endif
00130
00131 #endif // GEOS_NODING_SCALEDNODER_H