GEOS: geos::noding::snapround::HotPixel Class Reference

Public Member Functions

# geos::noding::snapround::HotPixel Class Reference

Implements a "hot pixel" as used in the Snap Rounding algorithm. More...

`#include <HotPixel.h>`

List of all members.

## Public Member Functions
| HotPixel (const geom::Coordinate &pt, double scaleFact, algorithm::LineIntersector &li)
const geom::Coordinate & | getCoordinate () const
| Return reference to original Coordinate (the one provided at construction time)
const geom::Envelope & | getSafeEnvelope () const
| Returns a "safe" envelope that is guaranteed to contain the hot pixel. Keeps ownership of it.
bool | intersects (const geom::Coordinate &p0, const geom::Coordinate &p1) const
bool | addSnappedNode (NodedSegmentString &segStr, std::size_t segIndex)

## 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

geos::noding::snapround::HotPixel::HotPixel | ( | const geom::Coordinate & | pt,
|  | double | scaleFact,
|  | algorithm::LineIntersector & | li
| ) |  |

Creates a new hot pixel.

Parameters:

  pt | the coordinate at the centre of the pixel. Will be kept by reference, so make sure to keep it alive.
  scaleFact | the scaleFactor determining the pixel size
  li | the intersector to use for testing intersection with line segments

## Member Function Documentation

bool geos::noding::snapround::HotPixel::addSnappedNode | ( | NodedSegmentString & | segStr,
|  | std::size_t | segIndex
| ) |  |

Adds a new node (equal to the snap pt) to the specified segment if the segment passes through the hot pixel

Parameters:

  segStr |
  segIndex |

Returns:
  true if a node was added to the segment

const geom::Envelope& geos::noding::snapround::HotPixel::getSafeEnvelope | ( | ) | const

Returns a "safe" envelope that is guaranteed to contain the hot pixel. Keeps ownership of it.

The envelope returned will be larger than the exact envelope of the pixel.

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:

  p0 | the first coordinate of the line segment to test
  p1 | the 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:

- HotPixel.h