GEOS 3.11.1
|
Implements a "hot pixel" as used in the Snap Rounding algorithm. More...
#include <HotPixel.h>
Public Member Functions | |
double | getWidth () const |
double | getScaleFactor () const |
HotPixel (const geom::Coordinate &pt, double scaleFactor) | |
const geom::Coordinate & | getCoordinate () const |
bool | intersects (const geom::Coordinate &p0, const geom::Coordinate &p1) const |
bool | intersects (const geom::Coordinate &p) const |
bool | isNode () const |
void | setToNode () |
std::ostream & | operator<< (std::ostream &os) |
Implements a "hot pixel" as used in the Snap Rounding algorithm.
A hot pixel contains the interior of the tolerance square and the boundary minus the top and right segments.
The hot pixel operations are all computed in the integer domain to avoid rounding problems.
geos::noding::snapround::HotPixel::HotPixel | ( | const geom::Coordinate & | pt, |
double | scaleFactor | ||
) |
Creates a new hot pixel.
pt | the coordinate at the centre of the pixel. Will be kept by reference, so make sure to keep it alive. |
scaleFactor | the scaleFactor determining the pixel size |
|
inline |
Gets the width of the hot pixel in the original coordinate system.
bool geos::noding::snapround::HotPixel::intersects | ( | const geom::Coordinate & | p | ) | const |
Tests whether a coordinate lies in (intersects) this hot pixel.
p | the coordinate to test |
bool geos::noding::snapround::HotPixel::intersects | ( | const geom::Coordinate & | p0, |
const geom::Coordinate & | p1 | ||
) | const |
Tests whether the line segment (p0-p1) intersects this hot pixel.
p0 | the first coordinate of the line segment to test |
p1 | the second coordinate of the line segment to test |