-added CountPointSet() to clustering

-ComputePerVertexQualityHistogram() modified; added a parameter to compute histogram taking into account just selected vertexes.
This commit is contained in:
Paolo Cignoni 2009-07-16 10:16:39 +00:00
parent b686bd1d31
commit 7e5a7630f2
2 changed files with 14 additions and 11 deletions

View File

@ -123,11 +123,11 @@ public:
template<class MeshType >
class NearestToCenter
{
typedef typename MeshType::ScalarType ScalarType;
typedef typename MeshType::CoordType CoordType;
typedef typename MeshType::VertexType VertexType;
typedef typename MeshType::FaceType FaceType;
typedef BasicGrid<typename MeshType::ScalarType> GridType;
typedef typename MeshType::ScalarType ScalarType;
typedef typename MeshType::CoordType CoordType;
typedef typename MeshType::VertexType VertexType;
typedef typename MeshType::FaceType FaceType;
typedef BasicGrid<typename MeshType::ScalarType> 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<HashedPoint3i,CellType>::iterator gi;
@ -382,8 +384,8 @@ class Clustering
}
}
void ExtractMesh(MeshType &m)
void ExtractMesh(MeshType &m)
{
m.Clear();

View File

@ -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());
}
}