From 6144006bfdfb441f12ad9a0b7fb348a366f4e68c Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 19 Oct 2007 22:29:36 +0000 Subject: [PATCH] Re-Wrote basic build function --- vcg/complex/trimesh/create/platonic.h | 51 +++++++++++++-------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/vcg/complex/trimesh/create/platonic.h b/vcg/complex/trimesh/create/platonic.h index ece3723d..a1005c2f 100644 --- a/vcg/complex/trimesh/create/platonic.h +++ b/vcg/complex/trimesh/create/platonic.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.11 2007/02/01 06:38:27 cignoni +Added small comment to grid function + Revision 1.10 2007/01/27 13:14:34 marfr960 Removed unuseful CoordType test @@ -570,8 +573,9 @@ void Box(MeshType &in, const typename MeshType::BoxType & bb ) } - /// Questa funzione costruisce una mesh a partire da un insieme di coordiante - /// ed un insieme di terne di indici di vertici +// this function build a mesh starting from a vector of generic coords (objects having a triple of float at their beginning) +// and a vector of faces (objects having a triple of ints at theri beginning). + template void Build( MeshType & in, const V & v, const F & f) @@ -582,25 +586,18 @@ void Build( MeshType & in, const V & v, const F & f) typedef typename MeshType::VertexIterator VertexIterator; typedef typename MeshType::FaceIterator FaceIterator; - in.vn = v.size(); - in.fn = f.size(); - - in.vert.clear(); - in.face.clear(); + Allocator::AddVertices(in,v.size()); + Allocator::AddFaces(in,f.size()); typename V::const_iterator vi; typename MeshType::VertexType tv; - tv.Supervisor_Flags()=0; +// tv.Supervisor_Flags()=0; - for(vi=v.begin();vi!=v.end();++vi) + for(int i=0;i index(in.vn); @@ -612,20 +609,20 @@ void Build( MeshType & in, const V & v, const F & f) typename F::const_iterator fi; typename MeshType::FaceType ft; - ft.Supervisor_Flags()=0; - for(fi=f.begin();fi!=f.end();++fi) + for(int i=0;i=0 ); - assert( (*fi)[1]>=0 ); - assert( (*fi)[2]>=0 ); - assert( (*fi)[0]=0 ); + assert( ff[1]>=0 ); + assert( ff[2]>=0 ); + assert( ff[0]