diff --git a/vcg/complex/trimesh/clustering.h b/vcg/complex/trimesh/clustering.h index 09bd191f..ab6dc5cb 100644 --- a/vcg/complex/trimesh/clustering.h +++ b/vcg/complex/trimesh/clustering.h @@ -123,11 +123,11 @@ public: template class NearestToCenter { - typedef typename MeshType::ScalarType ScalarType; - typedef typename MeshType::CoordType CoordType; - typedef typename MeshType::VertexType VertexType; - typedef typename MeshType::FaceType FaceType; - typedef BasicGrid GridType; + typedef typename MeshType::ScalarType ScalarType; + typedef typename MeshType::CoordType CoordType; + typedef typename MeshType::VertexType VertexType; + typedef typename MeshType::FaceType FaceType; + typedef BasicGrid GridType; public: inline void AddVertex(MeshType &m, GridType &g, Point3i &pi, VertexType &v) @@ -352,7 +352,9 @@ class Clustering // printf("Inserted %8i triangles, clustered to %8i tri and %i cells\n",distance(m.face.begin(),fi),TriSet.size(),GridCell.size()); } } - // + + int CountPointSet() {return GridCell.size(); } + void SelectPointSet(MeshType &m) { typename STDEXT::hash_map::iterator gi; @@ -382,8 +384,8 @@ class Clustering } } - - void ExtractMesh(MeshType &m) + + void ExtractMesh(MeshType &m) { m.Clear(); diff --git a/vcg/complex/trimesh/stat.h b/vcg/complex/trimesh/stat.h index 7b85c4bb..b5f7e936 100644 --- a/vcg/complex/trimesh/stat.h +++ b/vcg/complex/trimesh/stat.h @@ -108,7 +108,7 @@ class Stat } - static void ComputePerVertexQualityHistogram( MeshType & m, Histogramf &h) // V1.0 + static void ComputePerVertexQualityHistogram( MeshType & m, Histogramf &h, bool selectionOnly = false) // V1.0 { VertexIterator vi; int HistSize=10000; @@ -117,7 +117,7 @@ class Stat h.Clear(); h.SetRange( minmax.first,minmax.second, HistSize); for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) - if(!(*vi).IsD()) + 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()); @@ -143,7 +143,8 @@ class Stat h.Clear(); h.SetRange(newmin, newmax, HistSize*50); for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) - if(!(*vi).IsD()) h.Add((*vi).Q()); + if(!(*vi).IsD() && ((!selectionOnly) || (*vi).IsS()) ) + h.Add((*vi).Q()); } }