From 50b5c30d059f71dc6d8076a13a6bac3d581a3a3e Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Thu, 5 Aug 2004 22:27:00 +0000 Subject: [PATCH] added VFAppend funtion --- vcg/simplex/face/topology.h | 51 +++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index db850e9e..8e38c3df 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -24,6 +24,18 @@ History $Log: not supported by cvs2svn $ +Revision 1.10 2004/07/27 09:49:23 cignoni +Removed warning about postfix incremnet of VFIterator + +Revision 1.9 2004/07/15 12:03:07 ganovelli +minor changes + +Revision 1.8 2004/07/15 11:26:48 ganovelli +VFDetach corrected + +Revision 1.7 2004/05/12 12:23:23 cignoni +Conformed C++ syntax to GCC requirements + Revision 1.6 2004/05/11 16:03:18 ganovelli changed from "thi" to "&f" in Vfdetach @@ -160,8 +172,8 @@ void Attach(FaceType * &f, int z1, FaceType *&f2, int z2) EPB.NextF(); } //Salvo i dati di f1 prima di sovrascrivere - FaceType *f1prec = f->FFp(z1); - int z1prec = f->FFi(z1); + FaceType *f1prec = f.FFp(z1); + int z1prec = f.FFi(z1); //Aggiorno f1 f->FFp(z1) = TEPB.f->FFp(TEPB.z); f->FFi(z1) = TEPB.f->FFi(TEPB.z); @@ -216,39 +228,34 @@ void Swap (SwapFaceType &f, const int z ) // NOTA funziona SOLO per la topologia VF!!! // usata nelle classi di collapse template -void VFDetach(FaceType* &f, int z) +void VFDetach(FaceType & f, int z) { - if(f->V(z)->VFp()==f ) + if(f.V(z)->VFp()==&f ) //if it is the first face detach from the begin { - int fz = f->V(z)->VFi(); - f->V(z)->VFp() = (FaceType*) f->VFp(fz); - f->V(z)->VFi() = f->VFi(fz); + int fz = f.V(z)->VFi(); + f.V(z)->VFp() = f.VFp(fz); + f.V(z)->VFi() = f.VFi(fz); } - else + else // scan the list of faces in order to finde the current face f to be detached { - - vcg::face::VFIterator x,y; + VFIterator x(f.V(z)->VFp(),f.V(z)->VFi()); + VFIterator y; - x.f = f->V(z)->VFp(); - x.z = f->V(z)->VFi(); - y = x; - y++; - while (!y.End()) + for(;;) { - assert(y.f!=0); - if(y.f==f) + y = x; + ++x; + assert(x.f!=0); + if(x.f==&f) // found! { - x.f->VFp(x.z) = y.f->VFp(y.z); - x.f->VFi(x.z) = y.f->VFi(y.z); + y.f->VFp(y.z) = f.VFp(z); + y.f->VFi(y.z) = f.VFi(z); break; } - x++; - y++; } } } - /// Append a face in VF list of vertex f->V(z) template void VFAppend(FaceType* & f, int z)