From e29b18045c050e7076f1bc7597818d4458fd71bf Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 19 Jun 2014 10:26:13 +0000 Subject: [PATCH] Improved float/double consistency removing some wrong Point3f and substitued with MeshType::CoordType --- vcg/complex/algorithms/clean.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vcg/complex/algorithms/clean.h b/vcg/complex/algorithms/clean.h index 8dc97de0..676fd800 100644 --- a/vcg/complex/algorithms/clean.h +++ b/vcg/complex/algorithms/clean.h @@ -1369,7 +1369,7 @@ public: //detection stage for(unsigned int index = 0 ; index < m.face.size(); ++index ) { - FacePointer f = &(m.face[index]); float sides[3]; Point3 dummy; + FacePointer f = &(m.face[index]); float sides[3]; CoordType 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)); @@ -1383,7 +1383,7 @@ public: if(face::CheckFlipEdge( *f, i )) { // Check if EdgeFlipping improves quality FacePointer g = f->FFp(i); int k = f->FFi(i); - Triangle3 t1(f->P(i), f->P1(i), f->P2(i)), t2(g->P(k), g->P1(k), g->P2(k)), + Triangle3 t1(f->P(i), f->P1(i), f->P2(i)), t2(g->P(k), g->P1(k), g->P2(k)), t3(f->P(i), g->P2(k), f->P2(i)), t4(g->P(k), f->P2(i), g->P2(k)); if ( std::min( QualityFace(t1), QualityFace(t2) ) < std::min( QualityFace(t3), QualityFace(t4) )) @@ -1415,8 +1415,13 @@ public: //detection stage for(unsigned int index = 0 ; index < m.face.size(); ++index ) { - 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)); + FacePointer f = &(m.face[index]); + float sides[3]; + CoordType 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( tri::IsMarked(m,f->V2(i) )) continue; @@ -1670,7 +1675,7 @@ static std::pair RemoveSmallConnectedComponentsDiameter(MeshType &m, Sc tri::ConnectedComponentIterator ci; for(unsigned int i=0;i bb; std::vector FPV; for(ci.start(m,CCV[i].second);!ci.completed();++ci) {