From e6fe311c6d592d651b6305b247a463f8c3447a7e Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 20 Mar 2009 00:27:07 +0000 Subject: [PATCH] Updated DepthSmooth to the recent library changes --- vcg/complex/trimesh/smooth.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/vcg/complex/trimesh/smooth.h b/vcg/complex/trimesh/smooth.h index 73158c5c..d583da44 100644 --- a/vcg/complex/trimesh/smooth.h +++ b/vcg/complex/trimesh/smooth.h @@ -814,11 +814,10 @@ static void VertexCoordViewDepth(MeshType &m, const ScalarType alpha, int step, bool SmoothBorder=false ) { - SimpleTempData TD(m.vert); LaplacianInfo lpz; lpz.sum=CoordType(0,0,0); lpz.cnt=0; - TD.Start(lpz); + SimpleTempData TD(m.vert,lpz); for(int i=0;iSupervisor_P(); - TD[(*fi).V1(j)].sum+=(*fi).V(j)->Supervisor_P(); + TD[(*fi).V(j)].sum+=(*fi).V1(j)->cP(); + TD[(*fi).V1(j)].sum+=(*fi).V(j)->cP(); ++TD[(*fi).V(j)].cnt; ++TD[(*fi).V1(j)].cnt; } @@ -854,8 +853,8 @@ static void VertexCoordViewDepth(MeshType &m, for(int j=0;j<3;++j) if((*fi).IsB(j)) { - TD[(*fi).V(j)].sum+=(*fi).V1(j)->Supervisor_P(); - TD[(*fi).V1(j)].sum+=(*fi).V(j)->Supervisor_P(); + TD[(*fi).V(j)].sum+=(*fi).V1(j)->cP(); + TD[(*fi).V1(j)].sum+=(*fi).V(j)->cP(); ++TD[(*fi).V(j)].cnt; ++TD[(*fi).V1(j)].cnt; } @@ -864,13 +863,11 @@ static void VertexCoordViewDepth(MeshType &m, if(!(*vi).IsD() && TD[*vi].cnt>0 ) { CoordType np = TD[*vi].sum/TD[*vi].cnt; - CoordType d = (*vi).Supervisor_P() - viewpoint; d.Normalize(); - ScalarType s = d * ( np - (*vi).Supervisor_P() ); - (*vi).Supervisor_P() += d * (s*alpha); + CoordType d = (*vi).cP() - viewpoint; d.Normalize(); + ScalarType s = d * ( np - (*vi).cP() ); + (*vi).P() += d * (s*alpha); } } - - TD.Stop(); }