-added CountPointSet() to clustering
-ComputePerVertexQualityHistogram() modified; added a parameter to compute histogram taking into account just selected vertexes.
This commit is contained in:
parent
b686bd1d31
commit
7e5a7630f2
|
@ -123,11 +123,11 @@ public:
|
||||||
template<class MeshType >
|
template<class MeshType >
|
||||||
class NearestToCenter
|
class NearestToCenter
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexType VertexType;
|
typedef typename MeshType::VertexType VertexType;
|
||||||
typedef typename MeshType::FaceType FaceType;
|
typedef typename MeshType::FaceType FaceType;
|
||||||
typedef BasicGrid<typename MeshType::ScalarType> GridType;
|
typedef BasicGrid<typename MeshType::ScalarType> GridType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline void AddVertex(MeshType &m, GridType &g, Point3i &pi, VertexType &v)
|
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());
|
// 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)
|
void SelectPointSet(MeshType &m)
|
||||||
{
|
{
|
||||||
typename STDEXT::hash_map<HashedPoint3i,CellType>::iterator gi;
|
typename STDEXT::hash_map<HashedPoint3i,CellType>::iterator gi;
|
||||||
|
@ -382,8 +384,8 @@ class Clustering
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractMesh(MeshType &m)
|
void ExtractMesh(MeshType &m)
|
||||||
{
|
{
|
||||||
m.Clear();
|
m.Clear();
|
||||||
|
|
||||||
|
|
|
@ -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;
|
VertexIterator vi;
|
||||||
int HistSize=10000;
|
int HistSize=10000;
|
||||||
|
@ -117,7 +117,7 @@ class Stat
|
||||||
h.Clear();
|
h.Clear();
|
||||||
h.SetRange( minmax.first,minmax.second, HistSize);
|
h.SetRange( minmax.first,minmax.second, HistSize);
|
||||||
for(vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
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)");
|
assert(!math::IsNAN((*vi).Q()) && "You should never try to compute Histogram with Invalid Floating points numbers (NaN)");
|
||||||
h.Add((*vi).Q());
|
h.Add((*vi).Q());
|
||||||
|
@ -143,7 +143,8 @@ class Stat
|
||||||
h.Clear();
|
h.Clear();
|
||||||
h.SetRange(newmin, newmax, HistSize*50);
|
h.SetRange(newmin, newmax, HistSize*50);
|
||||||
for(vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue