From 4e8145f8db1cdcb516f1506eb5268f37010c2bb2 Mon Sep 17 00:00:00 2001 From: Nico Pietroni nicopietroni Date: Wed, 14 Oct 2009 15:23:06 +0000 Subject: [PATCH] changed SmartOptimizeStar function, it returns a bool. --- .../filter_isoparametrization/local_optimization.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/meshlabplugins/filter_isoparametrization/local_optimization.h b/src/meshlabplugins/filter_isoparametrization/local_optimization.h index ef527d003..90dd97202 100644 --- a/src/meshlabplugins/filter_isoparametrization/local_optimization.h +++ b/src/meshlabplugins/filter_isoparametrization/local_optimization.h @@ -178,15 +178,12 @@ void OptimizeStar(typename MeshType::VertexType *v,int accuracy=1) ////SETTING SPEED ScalarType edge_esteem=GetSmallestUVHeight(hlev_mesh); - - //ScalarType speed0=(2.0/(sqrt((ScalarType)mesh.vn/num_faces)))*optimize_speed_fact; - //ScalarType edge_esteem=GetSmallestUVHeight(hlev_mesh); ScalarType speed0=edge_esteem*0.5;//0.05; ScalarType conv=edge_esteem*0.2;//edge_esteem*0.05; if (accuracy>1) conv*=1.0/(ScalarType)((accuracy-1)*10.0); - + opt.SetSpeed(speed0); /*int ite=*/opt.IterateUntilConvergence(conv); @@ -275,7 +272,7 @@ void OptimizeStar(typename MeshType::VertexType *v,int accuracy=1) template -void SmartOptimizeStar(typename MeshType::VertexType *center,int accuracy=1) +bool SmartOptimizeStar(typename MeshType::VertexType *center,int accuracy=1) { typedef typename MeshType::VertexType VertexType; typedef typename MeshType::FaceType FaceType; @@ -294,8 +291,9 @@ void SmartOptimizeStar(typename MeshType::VertexType *center,int accuracy=1) ScalarType ratio=(ScalarType)sizeH/(ScalarType)faces.size(); if (ratio<=1) - return; + return false; else OptimizeStar(center,accuracy); + return true; } #endif