GEOS
3.9.1dev
|
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) |
Private Member Functions | |
double | scaleRound (double val) const |
double | scale (double val) const |
bool | intersectsPixelClosure (const geom::Coordinate &p0, const geom::Coordinate &p1) const |
bool | intersectsScaled (double p0x, double p0y, double p1x, double p1y) const |
HotPixel (const HotPixel &other)=delete | |
HotPixel & | operator= (const HotPixel &rhs)=delete |
Private Attributes | |
geom::Coordinate | originalPt |
double | scaleFactor |
bool | hpIsNode |
double | hpx |
double | hpy |
Static Private Attributes | |
static constexpr double | TOLERANCE = 0.5 |
static constexpr int | UPPER_RIGHT = 0 |
static constexpr int | UPPER_LEFT = 1 |
static constexpr int | LOWER_LEFT = 2 |
static constexpr int | LOWER_RIGHT = 3 |
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.
Definition at line 63 of file HotPixel.h.
|
privatedelete |
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 |
const geom::Coordinate& geos::noding::snapround::HotPixel::getCoordinate | ( | ) | const |
|
inline |
Definition at line 104 of file HotPixel.h.
|
inline |
Gets the width of the hot pixel in the original coordinate system.
Definition at line 102 of file HotPixel.h.
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 |
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 |
|
private |
|
private |
|
inline |
Definition at line 139 of file HotPixel.h.
std::ostream& geos::noding::snapround::HotPixel::operator<< | ( | std::ostream & | os | ) |
|
private |
|
private |
|
inline |
Definition at line 140 of file HotPixel.h.
References geos::geom::operator<<().
|
private |
Definition at line 78 of file HotPixel.h.
|
private |
Definition at line 81 of file HotPixel.h.
|
private |
Definition at line 82 of file HotPixel.h.
|
staticprivate |
Definition at line 71 of file HotPixel.h.
|
staticprivate |
Definition at line 72 of file HotPixel.h.
|
private |
Definition at line 74 of file HotPixel.h.
|
private |
Definition at line 75 of file HotPixel.h.
|
staticprivate |
Definition at line 67 of file HotPixel.h.
|
staticprivate |
Definition at line 70 of file HotPixel.h.
|
staticprivate |
Definition at line 69 of file HotPixel.h.