From ead8780772bc7c4d48cf75a62b83b5b863d09258 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 12 Oct 2005 10:47:21 +0000 Subject: [PATCH] Removed clearing of flags of added faces. Now the flag component has a constructor that clear it. FF and VF adjacency are updated only if they are present and consistent (e.g. only if VFp(k) != 0 or FFp(k)!=0) --- vcg/complex/trimesh/allocate.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/vcg/complex/trimesh/allocate.h b/vcg/complex/trimesh/allocate.h index 6344703f..dbc1cdd8 100644 --- a/vcg/complex/trimesh/allocate.h +++ b/vcg/complex/trimesh/allocate.h @@ -24,6 +24,10 @@ History $Log: not supported by cvs2svn $ +Revision 1.21 2005/07/01 11:22:00 cignoni +Corrected for the fourth time line a cast to Facetype at line 341. +Read the notes there before changing it again + Revision 1.20 2005/06/09 14:14:29 ganovelli two warnings on type cast @@ -297,11 +301,13 @@ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu pu.oldBase=&*m.face.begin(); last=m.face.end(); } - for(int i=0; i &pu { if(FaceType::HasFFAdjacency()) { - pu.Update((*fi).FFp(0)); - pu.Update((*fi).FFp(1)); - pu.Update((*fi).FFp(2)); + if ((*fi).cFFp(0)!=0) pu.Update((*fi).FFp(0)); + if ((*fi).cFFp(1)!=0) pu.Update((*fi).FFp(1)); + if ((*fi).cFFp(2)!=0) pu.Update((*fi).FFp(2)); } if(FaceType::HasVFAdjacency()) { //update pointers to chain of face incident in a vertex //update them only if they are different from zero - if ((*fi).VFp(0)!=0) + if ((*fi).cVFp(0)!=0) pu.Update((*fi).VFp(0)); - if ((*fi).VFp(1)!=0) + if ((*fi).cVFp(1)!=0) pu.Update((*fi).VFp(1)); - if ((*fi).VFp(2)!=0) + if ((*fi).cVFp(2)!=0) pu.Update((*fi).VFp(2)); } } @@ -336,7 +342,7 @@ static FaceIterator AddFaces(MeshType &m, int n, PointerUpdater &pu if(!(*vi).IsD()) { if(VertexType::HasVFAdjacency()) - if ((*vi).VFp()!=0) + if ((*vi).cVFp()!=0) pu.Update((FaceType * &)(*vi).VFp()); // Note the above cast is probably not useful if you have correctly defined // your vertex type with the correct name of the facetype as a template argument;