addSplitEdges method

void addSplitEdges(
  1. List edgeList
)

Creates new edges for all the edges that the intersections in this list split the parent edge into. Adds the edges to the provided argument list (this is so a single list can be used to accumulate all split edges for a set of {@link SegmentString}s).

Implementation

void addSplitEdges(List edgeList) {
  // ensure that the list has entries for the first and last point of the edge
  addEndpoints();
  addCollapsedNodes();

  Iterator it = iterator();
  // there should always be at least two entries in the list, since the endpoints are nodes
  it.moveNext();
  SegmentNode eiPrev = it.current;
  while (it.moveNext()) {
    SegmentNode ei = it.current;
    SegmentString newEdge = createSplitEdge(eiPrev, ei);
    /*
    if (newEdge.size() < 2)
      throw new RuntimeException("created single point edge: " + newEdge.toString());
    */
    edgeList.add(newEdge);
    eiPrev = ei;
  }
  //checkSplitEdgesCorrectness(testingSplitEdges);
}