findStabbedSegments method

List findStabbedSegments(
  1. Coordinate stabbingRayLeftPt
)

Finds all non-horizontal segments intersecting the stabbing line. The stabbing line is the ray to the right of stabbingRayLeftPt.

@param stabbingRayLeftPt the left-hand origin of the stabbing line @return a List of {@link DepthSegments} intersecting the stabbing line

Implementation

List findStabbedSegments(Coordinate stabbingRayLeftPt) {
  List stabbedSegments = [];
  for (BufferSubgraph bsg in subgraphs) {
    // optimization - don't bother checking subgraphs which the ray does not intersect
    Envelope env = bsg.getEnvelope();
    if (stabbingRayLeftPt.y < env.getMinY() ||
        stabbingRayLeftPt.y > env.getMaxY()) continue;

    findStabbedSegments3(
        stabbingRayLeftPt, bsg.getDirectedEdges(), stabbedSegments);
  }
  return stabbedSegments;
}