diff --git a/vcg/complex/allocate.h b/vcg/complex/allocate.h index c4b4156a..dab24639 100644 --- a/vcg/complex/allocate.h +++ b/vcg/complex/allocate.h @@ -114,7 +114,7 @@ namespace vcg { { public: PointerUpdater(void) : newBase(0), oldBase(0), newEnd(0), oldEnd(0), preventUpdateFlag(false) { ; } - void Clear(){newBase=oldBase=newEnd=oldEnd=0;}; + void Clear(){newBase=oldBase=newEnd=oldEnd=0;} void Update(SimplexPointerType &vp) { //if(vp>=newBase && vp &pu ) + { + // If already compacted fast return please! + if(m.en==(int)m.edge.size()) return; + + // remap [ ] gives you the new position of the edge in the vector; + pu.remap.resize( m.edge.size(),std::numeric_limits::max() ); + + size_t pos=0; + size_t i=0; + + for(i=0;i pu; + CompactEdgeVector(m,pu); + } /* Function to compact all the vertices that have been deleted and put them to the end of the vector.