GEOS 3.14.0dev
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
 
template<typename CoordType >
 HotPixel (const CoordType &pt, double scaleFact)
 
const geom::CoordinateXYZM & getCoordinate () const
 
bool intersects (const geom::CoordinateXY &p0, const geom::CoordinateXY &p1) const
 
bool intersects (const geom::CoordinateXY &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()

template<typename CoordType >
geos::noding::snapround::HotPixel::HotPixel ( const CoordType &  pt,
double  scaleFact 
)
inline

Creates a new hot pixel.

Parameters
ptthe coordinate at the centre of the pixel.
scaleFactthe 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::CoordinateXY &  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::CoordinateXY &  p0,
const geom::CoordinateXY &  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: