snap method

bool snap(
  1. HotPixel hotPixel,
  2. SegmentString? parentEdge,
  3. int hotPixelVertexIndex
)

Snaps (nodes) all interacting segments to this hot pixel. The hot pixel may represent a vertex of an edge, in which case this routine uses the optimization of not noding the vertex itself

@param hotPixel the hot pixel to snap to @param parentEdge the edge containing the vertex, if applicable, or null @param hotPixelVertexIndex the index of the hotPixel vertex, if applicable, or -1 @return true if a node was added for this pixel

Implementation

bool snap(
    HotPixel hotPixel, SegmentString? parentEdge, int hotPixelVertexIndex) {
  final Envelope pixelEnv = hotPixel.getSafeEnvelope();
  final HotPixelSnapAction hotPixelSnapAction =
      new HotPixelSnapAction(hotPixel, parentEdge, hotPixelVertexIndex);

  index.queryWithVisitor(
      pixelEnv, MonotoneChainIVisitor(pixelEnv, hotPixelSnapAction));
  return hotPixelSnapAction.isNodeAdded();
}