computeSelfNodes3 method

SegmentIntersector computeSelfNodes3(
  1. LineIntersector li,
  2. bool computeRingSelfNodes,
  3. bool isDoneIfProperInt
)

Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests. (E.g. rings are not tested for self-intersection, since they are assumed to be valid).

@param li the LineIntersector to use @param computeRingSelfNodes if false, intersection checks are optimized to not test rings for self-intersection @param isDoneIfProperInt short-circuit the intersection computation if a proper intersection is found @return the computed SegmentIntersector containing information about the intersections found

Implementation

SegmentIntersector computeSelfNodes3(
    LineIntersector li, bool computeRingSelfNodes, bool isDoneIfProperInt) {
  SegmentIntersector si = new SegmentIntersector(li, true, false);
  si.setIsDoneIfProperInt(isDoneIfProperInt);
  EdgeSetIntersector esi = createEdgeSetIntersector();
  // optimize intersection search for valid Polygons and LinearRings
  bool isRings = parentGeom is LinearRing ||
      parentGeom is Polygon ||
      parentGeom is MultiPolygon;
  bool computeAllSegments = computeRingSelfNodes || !isRings;
  esi.computeIntersections(edges, si, computeAllSegments);

  //System.out.println("SegmentIntersector # tests = " + si.numTests);
  addSelfIntersectionNodes(argIndex);
  return si;
}