- fixed crash caused by stupid call to histogram function when no matchable arcs were found (Fabio Ganovelli is responsible for the change)

This commit is contained in:
Guido Ranzuglia granzuglia 2014-03-31 16:14:13 +00:00
parent 89d010bd3a
commit dfa659b096

View File

@ -185,10 +185,6 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp)
}
}
vcg::Distribution<float> H; // stat for printing
for(QList<vcg::AlignPair::Result>::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<float> H; // stat for printing
for(QList<vcg::AlignPair::Result>::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);
}