HotPixel class

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.

@version 1.7

Constructors

HotPixel(Coordinate pt, double scaleFactor, LineIntersector li)
Creates a new hot pixel, using a given scale factor. The scale factor must be strictly positive (non-zero).

Properties

corner List<Coordinate>
The corners of the hot pixel, in the order: 10 23
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
li LineIntersector
getter/setter pair
maxx double
getter/setter pair
maxy double
getter/setter pair
minx double
getter/setter pair
miny double
getter/setter pair
originalPt Coordinate
getter/setter pair
p0Scaled Coordinate?
getter/setter pair
p1Scaled Coordinate?
getter/setter pair
pt Coordinate
getter/setter pair
ptScaled Coordinate?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeEnv Envelope?
getter/setter pair
scaleFactor double
getter/setter pair

Methods

addSnappedNode(NodedSegmentString segStr, int segIndex) bool
Adds a new node (equal to the snap pt) to the specified segment if the segment passes through the hot pixel
copyScaled(Coordinate p, Coordinate pScaled) → void
getCoordinate() Coordinate
Gets the coordinate this hot pixel is based at.
getSafeEnvelope() Envelope
Returns a "safe" envelope that is guaranteed to contain the hot pixel. The envelope returned will be larger than the exact envelope of the pixel.
initCorners(Coordinate pt) → void
intersects(Coordinate p0, Coordinate p1) bool
Tests whether the line segment (p0-p1) intersects this hot pixel.
intersectsPixelClosure(Coordinate p0, Coordinate p1) bool
Test whether the given segment intersects the closure of this hot pixel. This is NOT the test used in the standard snap-rounding algorithm, which uses the partially closed tolerance square instead. This routine is provided for testing purposes only.
intersectsScaled(Coordinate p0, Coordinate p1) bool
intersectsToleranceSquare(Coordinate p0, Coordinate p1) bool
Tests whether the segment p0-p1 intersects the hot pixel tolerance square. Because the tolerance square point set is partially open (along the top and right) the test needs to be more sophisticated than simply checking for any intersection. However, it can take advantage of the fact that the hot pixel edges do not lie on the coordinate grid. It is sufficient to check if any of the following occur:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale(double val) double
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

SAFE_ENV_EXPANSION_FACTOR double
final