com.vividsolutions.jts.noding.snapround

Class SimpleSnapRounder

Implemented Interfaces:
Noder

public class SimpleSnapRounder
extends java.lang.Object
implements Noder

Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of SegmentStrings. Implements the Snap Rounding technique described in Hobby, Guibas & Marimont, and Goodrich et al. Snap Rounding assumes that all vertices lie on a uniform grid (hence the precision model of the input must be fixed precision, and all the input vertices must be rounded to that precision).

This implementation uses simple iteration over the line segments.

This implementation appears to be fully robust using an integer precision model. It will function with non-integer precision models, but the results are not 100% guaranteed to be correctly noded.

Version:
1.7

Constructor Summary

SimpleSnapRounder(PrecisionModel pm)

Method Summary

static boolean
addSnappedNode(HotPixel hotPix, SegmentString segStr, int segIndex)
Adds a new node (equal to the snap pt) to the segment if the segment passes through the hot pixel
void
computeNodes(Collection inputSegmentStrings)
void
computeVertexSnaps(Collection edges)
Computes nodes introduced as a result of snapping segments to vertices of other segments
Collection
getNodedSubstrings()

Constructor Details

SimpleSnapRounder

public SimpleSnapRounder(PrecisionModel pm)

Method Details

addSnappedNode

public static boolean addSnappedNode(HotPixel hotPix,
                                     SegmentString segStr,
                                     int segIndex)
Adds a new node (equal to the snap pt) to the segment if the segment passes through the hot pixel
Parameters:
hotPix -
segStr -
segIndex -
Returns:
true if a node was added

computeNodes

public void computeNodes(Collection inputSegmentStrings)
Specified by:
computeNodes in interface Noder

computeVertexSnaps

public void computeVertexSnaps(Collection edges)
Computes nodes introduced as a result of snapping segments to vertices of other segments
Parameters:

getNodedSubstrings

public Collection getNodedSubstrings()
Specified by:
getNodedSubstrings in interface Noder