From 0a91defac85c75214b76e47e353c78ec9229cd80 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Thu, 11 Sep 2014 20:42:30 +0000 Subject: [PATCH] templated the function VertexClamp wrt input scalar type --- vcg/complex/algorithms/update/quality.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcg/complex/algorithms/update/quality.h b/vcg/complex/algorithms/update/quality.h index 885c82f4..1eed417f 100644 --- a/vcg/complex/algorithms/update/quality.h +++ b/vcg/complex/algorithms/update/quality.h @@ -68,11 +68,13 @@ static void VertexConstant(MeshType &m, float q) /** Clamp each vertex of the mesh with a range of values. */ -static void VertexClamp(MeshType &m, float qmin, float qmax) +static void VertexClamp(MeshType &m, + typename MeshType::ScalarType qmin, + typename MeshType::ScalarType qmax) { tri::RequirePerVertexQuality(m); for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD()) - (*vi).Q()=std::min(qmax, std::max(qmin,(*vi).Q())); + (*vi).Q()=min(qmax, max(qmin,(*vi).Q())); } /** Normalize the vertex quality so that it fits in the specified range.