From 810c3df9a4ebb32ea1f20aebc07cf0637e6f2404 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Wed, 14 Oct 2009 13:54:39 +0000 Subject: [PATCH] Changed TestVertexFace function in order to test if the each face is effectively added to the VF list of a vertex. --- vcg/complex/trimesh/update/topology.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vcg/complex/trimesh/update/topology.h b/vcg/complex/trimesh/update/topology.h index 992521a6..92c73a6e 100644 --- a/vcg/complex/trimesh/update/topology.h +++ b/vcg/complex/trimesh/update/topology.h @@ -405,7 +405,20 @@ static void FaceFaceFromTexCoord(MeshType &m) /// \brief Test correctness of VFtopology static void TestVertexFace(MeshType &m) { + SimpleTempData numVertex(m.vert,0); + if(!m.HasVFTopology()) return; + + FaceIterator fi; + for(fi=m.face.begin();fi!=m.face.end();++fi) + { + if (!(*fi).IsD()) + { + numVertex[(*fi).V0(0)]++; + numVertex[(*fi).V1(0)]++; + numVertex[(*fi).V2(0)]++; + } + } VertexIterator vi; vcg::face::VFIterator VFi; @@ -415,16 +428,21 @@ static void TestVertexFace(MeshType &m) if (!vi->IsD()) if(vi->VFp()!=0) // unreferenced vertices MUST have VF == 0; { + int num=0; assert(vi->VFp() >= &*m.face.begin()); assert(vi->VFp() <= &m.face.back()); VFi.f=vi->VFp(); VFi.z=vi->VFi(); while (!VFi.End()) { + num++; assert(!VFi.F()->IsD()); assert((VFi.F()->V(VFi.I()))==&(*vi)); ++VFi; } + int num1=numVertex[&(*vi)]; + assert(num==num1); + /*assert(num>1);*/ } } }