added ComputePerVertQualityAvg function
This commit is contained in:
parent
f81d5c7ed5
commit
872448ecba
|
@ -43,6 +43,7 @@ public:
|
||||||
typedef typename MeshType::VertexType VertexType;
|
typedef typename MeshType::VertexType VertexType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
typedef typename MeshType::ConstVertexIterator ConstVertexIterator;
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
typedef typename MeshType::FaceType FaceType;
|
typedef typename MeshType::FaceType FaceType;
|
||||||
typedef typename MeshType::FacePointer FacePointer;
|
typedef typename MeshType::FacePointer FacePointer;
|
||||||
|
@ -113,6 +114,22 @@ public:
|
||||||
return (AvgQ/(ScalarType)num);
|
return (AvgQ/(ScalarType)num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ScalarType ComputePerVertQualityAvg(const MeshType & m)
|
||||||
|
{
|
||||||
|
tri::RequirePerVertexQuality(m);
|
||||||
|
ScalarType AvgQ = 0;
|
||||||
|
|
||||||
|
ConstVertexIterator vi;
|
||||||
|
size_t num=0;
|
||||||
|
for(vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
||||||
|
{
|
||||||
|
if((*vi).IsD())continue;
|
||||||
|
AvgQ+= (*vi).cQ();
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
return (AvgQ/(ScalarType)num);
|
||||||
|
}
|
||||||
|
|
||||||
static std::pair<ScalarType,ScalarType> ComputePerEdgeQualityMinMax( MeshType & m)
|
static std::pair<ScalarType,ScalarType> ComputePerEdgeQualityMinMax( MeshType & m)
|
||||||
{
|
{
|
||||||
tri::RequirePerEdgeQuality(m);
|
tri::RequirePerEdgeQuality(m);
|
||||||
|
|
Loading…
Reference in New Issue