findCollapsesFromInsertedNodes method
Adds nodes for any collapsed edge pairs caused by inserted nodes Collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex. To provide the correct fully noded semantics, the vertex must be added as a node as well.
Implementation
void findCollapsesFromInsertedNodes(List<int> collapsedVertexIndexes) {
List<int> collapsedVertexIndex = List.filled(1, 0);
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;
bool isCollapsed = findCollapseIndex(eiPrev, ei, collapsedVertexIndex);
if (isCollapsed) collapsedVertexIndexes.add(collapsedVertexIndex[0]);
eiPrev = ei;
}
}