diff --git a/vcg/complex/trimesh/allocate.h b/vcg/complex/trimesh/allocate.h index 233ffb2c..feac2f0d 100644 --- a/vcg/complex/trimesh/allocate.h +++ b/vcg/complex/trimesh/allocate.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.16 2005/02/19 10:43:11 ponchio +reverted tarini mod + Revision 1.15 2005/02/08 17:14:28 tarini aggiunto un typecast a (FaceType*) per farlo compilare under Mingw comp @@ -160,13 +163,10 @@ static VertexIterator AddVertices(MeshType &m,int n, PointerUpdater &loca */ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu,std::vector &local_var) { - FaceIterator last = (FaceIterator)0; + FaceIterator last = (m.face.end(); pu.Clear(); if(m.face.empty()) { pu.oldBase=0; // if the vector is empty we cannot find the last valid element @@ -255,13 +255,10 @@ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu } // e poiche' lo spazio e' cambiato si ricalcola anche last da zero unsigned int siz=m.face.size()-n; - if(last!=(FaceIterator)0) - { - last = m.face.begin(); - advance(last,siz); - } - else last=m.face.begin(); - } + + last = m.face.begin(); + advance(last,siz); +} return last; } @@ -280,7 +277,7 @@ static FaceIterator AddFaces(MeshType &m, int n) */ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu) { - FaceIterator last = (FaceIterator)0; + FaceIterator last = m.face.end(); pu.Clear(); if(m.face.empty()) { pu.oldBase=0; // if the vector is empty we cannot find the last valid element @@ -334,12 +331,8 @@ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu } // e poiche' lo spazio e' cambiato si ricalcola anche last da zero unsigned int siz=m.face.size()-n; - if(last!=(FaceIterator)0) - { - last = m.face.begin(); - advance(last,siz); - } - else last=m.face.begin(); + last = m.face.begin(); + advance(last,siz); } return last;