From 05151acef531cfb71b41a8e611a92fe69263da78 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 29 Apr 2010 14:54:07 +0000 Subject: [PATCH] added ComputePerFaceQualityDistribution --- vcg/complex/trimesh/stat.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/vcg/complex/trimesh/stat.h b/vcg/complex/trimesh/stat.h index ae1309bb..a065100d 100644 --- a/vcg/complex/trimesh/stat.h +++ b/vcg/complex/trimesh/stat.h @@ -107,17 +107,27 @@ class Stat return area/ScalarType(2.0); } - static void ComputePerVertexQualityDistribution( MeshType & m, Distribution &h, bool selectionOnly = false) // V1.0 + static void ComputePerVertexQualityDistribution( MeshType & m, Distribution &h, bool selectionOnly = false) // V1.0 { - VertexIterator vi; - for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) - if(!(*vi).IsD() && ((!selectionOnly) || (*vi).IsS()) ) - { - assert(!math::IsNAN((*vi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)"); - h.Add((*vi).Q()); - } - } - + VertexIterator vi; + for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) + if(!(*vi).IsD() && ((!selectionOnly) || (*vi).IsS()) ) + { + assert(!math::IsNAN((*vi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)"); + h.Add((*vi).Q()); + } + } + + static void ComputePerFaceQualityDistribution( MeshType & m, Distribution &h, bool selectionOnly = false) // V1.0 + { + FaceIterator fi; + 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;