From f1d6d5d32a1cec9e65edc753f6c3b2deafb8530f Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 19 Jul 2012 08:09:28 +0000 Subject: [PATCH] Changed the GetInfo of the hole stuff. Now it require the userbit specified --- vcg/complex/algorithms/hole.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/vcg/complex/algorithms/hole.h b/vcg/complex/algorithms/hole.h index c3608114..f8ae531e 100644 --- a/vcg/complex/algorithms/hole.h +++ b/vcg/complex/algorithms/hole.h @@ -581,10 +581,10 @@ template } template - static int EarCuttingFill(MESH &m, int sizeHole,bool Selected = false, CallBackPos *cb=0) + static int EarCuttingFill(MESH &m, int sizeHole, const int UBIT, bool Selected = false, CallBackPos *cb=0) { std::vector< Info > vinfo; - int UBIT = GetInfo(m, Selected,vinfo); +// int UBIT = GetInfo(m, Selected,vinfo); typename std::vector::iterator ith; //Info app; @@ -616,10 +616,10 @@ template // it returns the number of created holes. template - static int EarCuttingIntersectionFill(MESH &m, int sizeHole, bool Selected = false, CallBackPos *cb=0) + static int EarCuttingIntersectionFill(MESH &m, int sizeHole, const int UBIT, CallBackPos *cb=0) { std::vector vinfo; - int UBIT = GetInfo(m, Selected,vinfo); +// int UBIT = GetInfo(m, Selected,vinfo); std::vector vf; PosType sp; PosType ap; @@ -674,12 +674,9 @@ template - static int GetInfo(MESH &m,bool Selected ,std::vector& VHI) + static void GetInfo(MESH &m, const int UBIT, bool Selected ,std::vector& VHI) { - FaceIterator fi; - int UBIT = FaceType::LastBitFlag(); - - for(fi = m.face.begin(); fi!=m.face.end(); ++fi) + for(FaceIterator fi = m.face.begin(); fi!=m.face.end(); ++fi) { if(!(*fi).IsD()) { @@ -693,7 +690,7 @@ template { for(int j =0; j<3 ; ++j) { - if( face::IsBorder(*fi,j) && !(*fi).IsUserBit(UBIT) ) + if( face::IsBorder(*fi,j) && !(*fi).IsUserBit(UBIT) ) {//Trovato una faccia di bordo non ancora visitata. (*fi).SetUserBit(UBIT); PosType sp(&*fi, j, (*fi).V(j)); @@ -703,7 +700,7 @@ template Box3Type hbox; hbox.Add(sp.v->cP()); //printf("Looping %i : (face %i edge %i) \n", VHI.size(),sp.f-&*m.face.begin(),sp.z); - sp.f->SetUserBit(UBIT); + sp.f->SetUserBit(UBIT); do { sp.f->SetUserBit(UBIT); @@ -721,7 +718,6 @@ template }//S & !S }//!IsD() }//for principale!!! - return UBIT; } //Minimum Weight Algorithm @@ -919,7 +915,7 @@ template triangulate(m,f,k,j,vi,vv); } - static void MinimumWeightFill(MESH &m, int holeSize, bool Selected) + static void MinimumWeightFill(MESH &m, const int UBIT, int holeSize, bool Selected) { FaceIterator fi; std::vector vvi; @@ -927,7 +923,7 @@ template std::vector vinfo; typename std::vector::iterator VIT; - GetInfo(m, Selected,vinfo); + GetInfo(m, UBIT, Selected,vinfo); for(VIT = vinfo.begin(); VIT != vinfo.end();++VIT) {