linkAllDirectedEdges method

void linkAllDirectedEdges()

Implementation

void linkAllDirectedEdges() {
  getEdges();
  // find first area edge (if any) to start linking at
  DirectedEdge? prevOut = null;
  DirectedEdge? firstIn = null;
  // link edges in CW order
  for (int i = edgeList!.length - 1; i >= 0; i--) {
    DirectedEdge nextOut = edgeList![i] as DirectedEdge;
    DirectedEdge nextIn = nextOut.getSym();
    if (firstIn == null) firstIn = nextIn;
    if (prevOut != null) nextIn.setNext(prevOut);
    // record outgoing edge, in order to link the last incoming edge
    prevOut = nextOut;
  }
  firstIn!.setNext(prevOut!);
//Debug.print(this);
}