Added ComputePerFaceQualityHistogram (provided by Andrea Tagliasacchi)

This commit is contained in:
Paolo Cignoni 2010-05-05 12:30:58 +00:00
parent b10bfc04e2
commit 7473b2177a
1 changed files with 15 additions and 0 deletions

View File

@ -128,6 +128,21 @@ class Stat
h.Add((*fi).Q());
}
}
static void ComputePerFaceQualityHistogram( MeshType & m, Histogramf &h, bool selectionOnly=false )
{
FaceIterator fi;
int HistSize=10000;
std::pair<float,float> minmax = tri::Stat<MeshType>::ComputePerFaceQualityMinMax(m);
h.Clear();
h.SetRange( minmax.first,minmax.second, HistSize );
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
if(!(*fi).IsD() && ((!selectionOnly) || (*fi).IsS()) ){
assert(!math::IsNAN((*fi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
h.Add((*fi).Q());
}
}
static void ComputePerVertexQualityHistogram( MeshType & m, Histogramf &h, bool selectionOnly = false) // V1.0
{
VertexIterator vi;