From 177cf43069eb8cfdd2a7ef258c454ef7d129e31e Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 6 Nov 2014 15:10:00 +0000 Subject: [PATCH] Added two other meshAssert tests (quads and tris) --- vcg/complex/algorithms/mesh_assert.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vcg/complex/algorithms/mesh_assert.h b/vcg/complex/algorithms/mesh_assert.h index fd2dcf36..93ffff79 100644 --- a/vcg/complex/algorithms/mesh_assert.h +++ b/vcg/complex/algorithms/mesh_assert.h @@ -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