GEOS 3.11.1
Public Member Functions | List of all members
geos::noding::snapround::HotPixel Class Reference

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::CoordinategetCoordinate () 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ HotPixel()

geos::noding::snapround::HotPixel::HotPixel ( const geom::Coordinate pt,
double  scaleFactor 
)

Creates a new hot pixel.

Parameters
ptthe coordinate at the centre of the pixel. Will be kept by reference, so make sure to keep it alive.
scaleFactorthe scaleFactor determining the pixel size

Member Function Documentation

◆ getWidth()

double geos::noding::snapround::HotPixel::getWidth ( ) const
inline

Gets the width of the hot pixel in the original coordinate system.

◆ intersects() [1/2]

bool geos::noding::snapround::HotPixel::intersects ( const geom::Coordinate p) const

Tests whether a coordinate lies in (intersects) this hot pixel.

Parameters
pthe coordinate to test
Returns
true if the coordinate intersects this hot pixel

◆ intersects() [2/2]

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.

Parameters
p0the first coordinate of the line segment to test
p1the second coordinate of the line segment to test
Returns
true if the line segment intersects this hot pixel

The documentation for this class was generated from the following file: