00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_SNAPROUND_HOTPIXEL_H
00021 #define GEOS_NODING_SNAPROUND_HOTPIXEL_H
00022
00023 #include <geos/inline.h>
00024
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/geom/Envelope.h>
00027
00028
00029 namespace geos {
00030 namespace geom {
00031 class Envelope;
00032 }
00033 namespace algorithm {
00034 class LineIntersector;
00035 }
00036 }
00037
00038 namespace geos {
00039 namespace noding {
00040 namespace snapround {
00041
00053 class HotPixel {
00054
00055 private:
00056
00057 algorithm::LineIntersector& li;
00058
00059 geom::Coordinate pt;
00060 const geom::Coordinate& originalPt;
00061 geom::Coordinate ptScaled;
00062
00063 double scaleFactor;
00064
00065 double minx;
00066 double maxx;
00067 double miny;
00068 double maxy;
00069
00077 std::vector<geom::Coordinate> corner;
00078
00080 mutable std::auto_ptr<geom::Envelope> safeEnv;
00081
00082 void initCorners(const geom::Coordinate& pt);
00083
00084 double scale(double val) const;
00085
00086 void copyScaled(const geom::Coordinate& p,
00087 geom::Coordinate& pScaled) const;
00088
00110 bool intersectsToleranceSquare(const geom::Coordinate& p0,
00111 const geom::Coordinate& p1) const;
00112
00113
00128 bool intersectsPixelClosure(const geom::Coordinate& p0,
00129 const geom::Coordinate& p1);
00130
00131 public:
00132
00133 HotPixel(const geom::Coordinate& pt,
00134 double scaleFact,
00135 algorithm::LineIntersector& li);
00136
00140 const geom::Coordinate& getCoordinate() const { return originalPt; }
00141
00146 const geom::Envelope& getSafeEnvelope() const;
00147
00148 bool intersectsScaled(const geom::Coordinate& p0,
00149 const geom::Coordinate& p1) const;
00150
00151 bool intersects(const geom::Coordinate& p0,
00152 const geom::Coordinate& p1) const;
00153
00154
00155 };
00156
00157
00158
00159 }
00160 }
00161 }
00162
00163 #ifdef GEOS_INLINE
00164 # include "geos/noding/snapround/HotPixel.inl"
00165 #endif
00166
00167 #endif // GEOS_NODING_SNAPROUND_HOTPIXEL_H
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181