From b50e3f77608b62226cf5844094e37f688a072717 Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 5 Nov 2007 23:47:20 +0000 Subject: [PATCH] added selection to the pasodoble smoothing --- vcg/complex/trimesh/smooth.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/vcg/complex/trimesh/smooth.h b/vcg/complex/trimesh/smooth.h index 7131fac7..acbf08d8 100644 --- a/vcg/complex/trimesh/smooth.h +++ b/vcg/complex/trimesh/smooth.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.14 2007/03/27 09:40:47 cignoni +Changed use of selected to visited flags. Improved variable namings and comments + Revision 1.13 2006/11/07 15:13:56 zifnab1974 Necessary changes for compilation with gcc 3.4.6. Especially the hash function is a problem @@ -819,7 +822,8 @@ void FitMesh(MESH_TYPE &m, template void FastFitMesh(MESH_TYPE &m, SimpleTempData > &TDV, - SimpleTempData > &TDF) + SimpleTempData > &TDF, + bool OnlySelected=false) { //vcg::face::Pos ep; vcg::face::VFIterator ep; @@ -842,9 +846,16 @@ void FastFitMesh(MESH_TYPE &m, TDV[*vi].np=(*vi).P()+ Sum*(1.0/cnt); } - for(vi=m.vert.begin();vi!=m.vert.end();++vi) + if(OnlySelected) + { + for(vi=m.vert.begin();vi!=m.vert.end();++vi) + if((*vi).IsS()) (*vi).P()=TDV[*vi].np; + } + else + { + for(vi=m.vert.begin();vi!=m.vert.end();++vi) (*vi).P()=TDV[*vi].np; - + } } @@ -910,7 +921,7 @@ void PasoDobleSmoothFast(MeshType &m, int step, typename MeshType::ScalarType Si NormalSmooth(m,TDF,Sigma); for(int j=0;j(m,TDV,TDF); + FastFitMesh(m,TDV,TDF,SmoothSelected);