private void Pop(cVertexList top) { //simulating a stack behavior for cVertexList list //Pop procedure cVertex last = new cVertex(); //last=top0.head.prev; top.Delete(top.head.PrevVertex); }
/*--------------------------------------------------------------------- * CleanVertices runs through the vertex list and deletes the * vertices that are marked as processed but are not incident to any * undeleted edges. * ---------------------------------------------------------------------*/ protected void CleanVertices() { cEdge e; cVertex v, t; /* Mark all vertices incident to some undeleted edge as on the hull. */ e = Edges.head; do { e.Endpts[0].IsOnHull = e.Endpts[1].IsOnHull = ONHULL; e = e.next; } while (e != Edges.head); /* Delete all vertices that have been processed but * are not on the hull. */ while (Vertices.head != null && Vertices.head.IsProcessed && !Vertices.head.IsOnHull) { v = Vertices.head; Vertices.Delete(v); } v = Vertices.head.NextVertex; do { if (v.IsProcessed && !v.IsOnHull) { t = v; v = v.NextVertex; Vertices.Delete(t); } else { v = v.NextVertex; } } while (v != Vertices.head); /* Reset flags. */ v = Vertices.head; do { v.Edge = null; v.IsOnHull = !ONHULL; v = v.NextVertex; } while (v != Vertices.head); }
/*--------------------------------------------------------------------- * Squash removes all elements from list marked delete. * ---------------------------------------------------------------------*/ private void Squash() { cVertex v = new cVertex(); v = list.head; for (i = 0; i < list.n; i++) { if (v.IsProcessed) { list.Delete(v); } v = v.NextVertex; } }