From dfa659b0967ff044ca1b42481ecc678168a105f3 Mon Sep 17 00:00:00 2001 From: Guido Ranzuglia granzuglia Date: Mon, 31 Mar 2014 16:14:13 +0000 Subject: [PATCH] - fixed crash caused by stupid call to histogram function when no matchable arcs were found (Fabio Ganovelli is responsible for the change) --- src/meshlabplugins/edit_align/meshtree.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/meshlabplugins/edit_align/meshtree.cpp b/src/meshlabplugins/edit_align/meshtree.cpp index 662bade27..af0d9702d 100644 --- a/src/meshlabplugins/edit_align/meshtree.cpp +++ b/src/meshlabplugins/edit_align/meshtree.cpp @@ -185,10 +185,6 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) } } - vcg::Distribution H; // stat for printing - for(QList::iterator li=resultList.begin();li!=resultList.end();++li) - H.Add(li->err); - cb(0,qPrintable(buf.sprintf("Completed Mesh-Mesh Alignment: Avg Err %5.3f Median %5.3f 90\% %5.3f\n",H.Avg(),H.Percentile(0.5f),H.Percentile(0.9f)))); //if there are no arcs at all complain and return if(totalArcNum==0) { @@ -202,6 +198,11 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) return; } + vcg::Distribution H; // stat for printing + for(QList::iterator li=resultList.begin();li!=resultList.end();++li) + H.Add(li->err); + cb(0,qPrintable(buf.sprintf("Completed Mesh-Mesh Alignment: Avg Err %5.3f Median %5.3f 90\% %5.3f\n",H.Avg(),H.Percentile(0.5f),H.Percentile(0.9f)))); + ProcessGlobal(ap); }