From d55a1069de82ebedbf21aa4e77dab46f21b80e55 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 19 Mar 2010 22:56:30 +0000 Subject: [PATCH] converted to the new style with mark outside the trimesh class --- vcg/complex/trimesh/clean.h | 22 +++++++++++----------- vcg/complex/trimesh/closest.h | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/vcg/complex/trimesh/clean.h b/vcg/complex/trimesh/clean.h index 21be8f7d..df3698f0 100644 --- a/vcg/complex/trimesh/clean.h +++ b/vcg/complex/trimesh/clean.h @@ -262,9 +262,9 @@ public: if( !face::IsBorder(*fpt,j) ) { FacePointer l=fpt->FFp(j); - if( !mp->IsMarked(l) ) + if( !tri::IsMarked(*mp,l) ) { - mp->Mark(l); + tri::Mark(*mp,l); sf.push(l); } } @@ -274,10 +274,10 @@ public: { mp=&m; while(!sf.empty()) sf.pop(); - mp->UnMarkAll(); + UnMarkAll(m); assert(p); assert(!p->IsD()); - mp->Mark(p); + tri::Mark(m,p); sf.push(p); } bool completed() { @@ -1341,7 +1341,7 @@ private: do { tri::UpdateTopology::FaceFace(m); - m.UnMarkAll(); + tri::UnMarkAll(m); count = 0; //detection stage @@ -1350,11 +1350,11 @@ private: FacePointer f = &(m.face[index]); float sides[3]; Point3 dummy; sides[0] = Distance(f->P(0), f->P(1)); sides[1] = Distance(f->P(1), f->P(2)); sides[2] = Distance(f->P(2), f->P(0)); int i = std::find(sides, sides+3, std::max( std::max(sides[0],sides[1]), sides[2])) - (sides); - if( m.IsMarked(f->V2(i) )) continue; + if( tri::IsMarked(m,f->V2(i) )) continue; if( PSDist(f->P2(i),f->P(i),f->P1(i),dummy)*threshold <= sides[i] ) { - m.Mark(f->V2(i)); + tri::Mark(m,f->V2(i)); if(face::CheckFlipEdge( *f, i )) { // Check if EdgeFlipping improves quality FacePointer g = f->FFp(i); int k = f->FFi(i); @@ -1385,7 +1385,7 @@ private: int count, total = 0; do { - m.UnMarkAll(); + tri::UnMarkAll(m); count = 0; //detection stage @@ -1394,14 +1394,14 @@ private: FacePointer f = &(m.face[index]); float sides[3]; Point3 dummy; sides[0] = Distance(f->P(0), f->P(1)); sides[1] = Distance(f->P(1), f->P(2)); sides[2] = Distance(f->P(2), f->P(0)); int i = std::find(sides, sides+3, std::max( std::max(sides[0],sides[1]), sides[2])) - (sides); - if( m.IsMarked(f->V2(i) )) continue; + if( tri::IsMarked(m,f->V2(i) )) continue; if( PSDist(f->P2(i),f->P(i),f->P1(i),dummy)*threshold <= sides[i] ) { - m.Mark(f->V2(i)); + tri::Mark(m,f->V2(i)); int j = Distance(dummy,f->P(i))P1(i))?i:(i+1)%3; - f->P2(i) = f->P(j); m.Mark(f->V(j)); + f->P2(i) = f->P(j); tri::Mark(m,f->V(j)); ++count; ++total; } } diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index e0f6c909..de64c1b5 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -135,6 +135,7 @@ header added #include #include #include +#include namespace vcg { namespace tri {