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 input list (this is so a single list can be used to accumulate all split edges for a Geometry).

@param edgeList a list of EdgeIntersections

Implementation

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

  Iterator it = iterator();
  // there should always be at least two entries in the list
  it.moveNext();
  EdgeIntersection eiPrev = it.current;
  while (it.moveNext()) {
    EdgeIntersection ei = it.current;
    Edge newEdge = createSplitEdge(eiPrev, ei);
    edgeList.add(newEdge);

    eiPrev = ei;
  }
}