From c9194ae005ebfc7f3ddc93c3966714d9c7e51fa4 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 5 Jul 2017 23:52:38 +0200 Subject: [PATCH] added bool SmoothSelected in VertexCoordScaleDependentLaplacian_Fujiwara --- vcg/complex/algorithms/smooth.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcg/complex/algorithms/smooth.h b/vcg/complex/algorithms/smooth.h index 21c827a7..a31f1bb0 100644 --- a/vcg/complex/algorithms/smooth.h +++ b/vcg/complex/algorithms/smooth.h @@ -125,7 +125,7 @@ static void VertexCoordLaplacianAngleWeighted(MeshType &m, int step, ScalarType // Note the delta parameter is in a absolute unit // to get stability it should be a small percentage of the shortest edge. -static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, ScalarType delta) +static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, ScalarType delta,bool SmoothSelected=false) { SimpleTempData TD(m.vert); ScaleLaplacianInfo lpz; @@ -181,7 +181,10 @@ static void VertexCoordScaleDependentLaplacian_Fujiwara(MeshType &m, int step, S for(vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD() && TD[*vi].LenSum>0 ) - (*vi).P() = (*vi).P() + (TD[*vi].PntSum/TD[*vi].LenSum)*delta; + { + if(!SmoothSelected || (*vi).IsS()) + (*vi).P() = (*vi).P() + (TD[*vi].PntSum/TD[*vi].LenSum)*delta; + } } };