Added test in AddVertices to do not update un-initalized vert references (for newly allocated faces)

This commit is contained in:
Paolo Cignoni 2007-01-11 10:24:25 +00:00
parent 7f78cbb1d5
commit f4d3561502
1 changed files with 6 additions and 3 deletions
vcg/complex/trimesh

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.35 2006/11/29 15:58:50 cignoni
Added check with the new end and avoided dangerous updating of already updated pointers
Revision 1.34 2006/11/28 22:34:28 cignoni Revision 1.34 2006/11/28 22:34:28 cignoni
Added default constructor with null initialization to adjacency members. Added default constructor with null initialization to adjacency members.
AddFaces and AddVertices NEED to know if the topology is correctly computed to update it. AddFaces and AddVertices NEED to know if the topology is correctly computed to update it.
@ -218,9 +221,9 @@ namespace vcg {
for (fi=m.face.begin(); fi!=m.face.end(); ++fi) for (fi=m.face.begin(); fi!=m.face.end(); ++fi)
if(!(*fi).IsD()) if(!(*fi).IsD())
{ {
pu.Update((*fi).V(0)); if ((*fi).cV(0)!=0) pu.Update((*fi).V(0));
pu.Update((*fi).V(1)); if ((*fi).cV(1)!=0) pu.Update((*fi).V(1));
pu.Update((*fi).V(2)); if ((*fi).cV(2)!=0) pu.Update((*fi).V(2));
} }
// e poiche' lo spazio e' cambiato si ricalcola anche last da zero // e poiche' lo spazio e' cambiato si ricalcola anche last da zero