improved behaviour of distribution/histogram in presence of NaN
This commit is contained in:
parent
448c340d3a
commit
a0d239ec26
|
|
@ -299,11 +299,14 @@ public:
|
||||||
static void ComputePerVertexQualityDistribution(const MeshType & m, Distribution<ScalarType> & h, bool selectionOnly = false) // V1.0
|
static void ComputePerVertexQualityDistribution(const MeshType & m, Distribution<ScalarType> & h, bool selectionOnly = false) // V1.0
|
||||||
{
|
{
|
||||||
tri::RequirePerVertexQuality(m);
|
tri::RequirePerVertexQuality(m);
|
||||||
|
h.Clear();
|
||||||
for(ConstVertexIterator vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
for(ConstVertexIterator vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
||||||
if(!(*vi).IsD() && ((!selectionOnly) || (*vi).IsS()) )
|
if(!(*vi).IsD() && ((!selectionOnly) || (*vi).IsS()) )
|
||||||
{
|
{
|
||||||
assert(!math::IsNAN((*vi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
|
if(!math::IsNAN((*vi).Q()))
|
||||||
h.Add((*vi).Q());
|
h.Add((*vi).Q());
|
||||||
|
else
|
||||||
|
assert( "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -311,11 +314,14 @@ public:
|
||||||
bool selectionOnly = false) // V1.0
|
bool selectionOnly = false) // V1.0
|
||||||
{
|
{
|
||||||
tri::RequirePerFaceQuality(m);
|
tri::RequirePerFaceQuality(m);
|
||||||
|
h.Clear();
|
||||||
for(ConstFaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
for(ConstFaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||||
if(!(*fi).IsD() && ((!selectionOnly) || (*fi).IsS()) )
|
if(!(*fi).IsD() && ((!selectionOnly) || (*fi).IsS()) )
|
||||||
{
|
{
|
||||||
assert(!math::IsNAN((*fi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
|
if(!math::IsNAN((*fi).Q()))
|
||||||
h.Add((*fi).Q());
|
h.Add((*fi).Q());
|
||||||
|
else
|
||||||
|
assert( "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue