Disambiguated two Folded functions into IsFolded and FoldedNum

This commit is contained in:
Paolo Cignoni 2017-12-21 01:20:57 +01:00
parent 796e2338ab
commit 6625a319b9
1 changed files with 12 additions and 14 deletions

View File

@ -385,7 +385,7 @@ public:
///return the number of folded faces ///return the number of folded faces
static bool Folded(const FaceType *f) static bool IsFolded(const FaceType *f)
{ {
ScalarType areaUV=AreaUV(f); ScalarType areaUV=AreaUV(f);
/*if (areaUV<0) /*if (areaUV<0)
@ -393,32 +393,30 @@ public:
return (areaUV<0); return (areaUV<0);
} }
static int Folded(const MeshType &m) static int FoldedNum(const MeshType &m)
{ {
int folded=0; int folded=0;
for (size_t i=0;i<m.face.size();i++)
{ ForEachFace(m, [&](const FaceType &f){
if (m.face[i].IsD())continue; if(IsFolded(&f)) folded++;
if(Folded(&m.face[i]))folded++; });
}
return folded; return folded;
} }
static bool GloballyUnFolded(const MeshType &m) static bool GloballyUnFolded(const MeshType &m)
{ {
int num=Folded(m); int num=FoldedNum(m);
return (num>(m.fn)/2); return (num>(m.fn)/2);
} }
static ScalarType MeshAngleDistortion(const MeshType &m) static ScalarType MeshAngleDistortion(const MeshType &m)
{ {
ScalarType UDdist=0; ScalarType UDdist=0;
for (size_t i=0;i<m.face.size();i++) ForEachFace(m, [&](const FaceType &f){
{ UDdist += AngleDistortion(f)*Area3D(f);
if (m.face[i].IsD())continue; });
const FaceType *f=&(m.face[i]);
UDdist+=AngleDistortion(f)*Area3D(f);
}
return UDdist; return UDdist;
} }