Added two other meshAssert tests (quads and tris)

This commit is contained in:
Paolo Cignoni 2014-11-06 15:10:00 +00:00
parent e1027dedb5
commit 177cf43069
1 changed files with 18 additions and 0 deletions

View File

@ -86,6 +86,24 @@ public:
} }
} }
static void OnlyTriFace(MeshType &m)
{
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) if(!fi->IsD())
{
if(fi->VN()!=3)
throw vcg::MissingPreconditionException("There are faces with more than three vertices");
}
}
static void OnlyQuadFace(MeshType &m)
{
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) if(!fi->IsD())
{
if(fi->VN()!=4)
throw vcg::MissingPreconditionException("There are non quadrilateral faces");
}
}
}; };
} // end namespace tri } // end namespace tri