computeEdgeEndsWithEdge method

void computeEdgeEndsWithEdge(
  1. Edge edge,
  2. List l
)

Creates stub edges for all the intersections in this Edge (if any) and inserts them into the graph.

Implementation

void computeEdgeEndsWithEdge(Edge edge, List l) {
  EdgeIntersectionList eiList = edge.getEdgeIntersectionList();
//Debug.print(eiList);
  // ensure that the list has entries for the first and last point of the edge
  eiList.addEndpoints();

  Iterator it = eiList.iterator();
  EdgeIntersection? eiPrev = null;
  EdgeIntersection? eiCurr = null;
  // no intersections, so there is nothing to do
  if (!it.moveNext()) return;
  EdgeIntersection? eiNext = it.current as EdgeIntersection;
  do {
    eiPrev = eiCurr;
    eiCurr = eiNext;
    eiNext = null;
    if (it.moveNext()) eiNext = it.current as EdgeIntersection;

    if (eiCurr != null) {
      createEdgeEndForPrev(edge, l, eiCurr, eiPrev);
      createEdgeEndForNext(edge, l, eiCurr, eiNext);
    }
  } while (eiCurr != null);
}