From fafe0f0293e6a358529e13db850b8248f88fb5ba Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Sun, 9 Dec 2012 16:09:18 +0000 Subject: [PATCH] Added function UpdateUVBox --- wrap/miq/core/param_stats.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wrap/miq/core/param_stats.h b/wrap/miq/core/param_stats.h index 58b0fb2f..94532af0 100644 --- a/wrap/miq/core/param_stats.h +++ b/wrap/miq/core/param_stats.h @@ -171,6 +171,26 @@ typename FaceType::ScalarType LaplaceDistortion(FaceType &f ,typename FaceType:: return lapl; } +template< class MeshType> +void UpdateUVBox(MeshType &mesh) +{ + typedef typename MeshType::ScalarType ScalarType; + typename MeshType::template PerMeshAttributeHandle > Handle_UVBox; + bool HasUVBox=vcg::tri::HasPerMeshAttribute(mesh,std::string("UVBox")); + if (!HasUVBox) + Handle_UVBox=vcg::tri::Allocator::template AddPerMeshAttribute >(mesh,std::string("UVBox")); + else + Handle_UVBox=vcg::tri::Allocator::template GetPerMeshAttribute >(mesh,"UVBox"); + Handle_UVBox().SetNull(); + for (unsigned int i=0;i void SetFaceQualityByDistortion(MeshType &Tmesh, typename MeshType::ScalarType h)