public class HotPixel extends Object
The hot pixel operations are all computed in the integer domain to avoid rounding problems.
| Constructor and Description |
|---|
HotPixel(Coordinate pt,
double scaleFactor,
LineIntersector li)
Creates a new hot pixel, using a given scale factor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSnappedNode(NodedSegmentString segStr,
int segIndex)
Adds a new node (equal to the snap pt) to the specified segment
if the segment passes through the hot pixel
|
Coordinate |
getCoordinate()
Gets the coordinate this hot pixel is based at.
|
Envelope |
getSafeEnvelope()
Returns a "safe" envelope that is guaranteed to contain the hot pixel.
|
boolean |
intersects(Coordinate p0,
Coordinate p1)
Tests whether the line segment (p0-p1)
intersects this hot pixel.
|
public HotPixel(Coordinate pt, double scaleFactor, LineIntersector li)
pt - the coordinate at the centre of the pixelscaleFactor - the scaleFactor determining the pixel size. Must be > 0li - the intersector to use for testing intersection with line segmentspublic Coordinate getCoordinate()
public Envelope getSafeEnvelope()
public boolean intersects(Coordinate p0, Coordinate p1)
p0 - the first coordinate of the line segment to testp1 - the second coordinate of the line segment to testpublic boolean addSnappedNode(NodedSegmentString segStr, int segIndex)
segStr - segIndex - Copyright © 2019. All rights reserved.