From 68beee8a279a16726a134d2a24c0d4f82bf4e13b Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 10 Mar 2004 00:37:31 +0000 Subject: [PATCH] Added gcc required typenames to tetrahedron and octaehedron --- vcg/complex/trimesh/platonic.h | 69 ++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/vcg/complex/trimesh/platonic.h b/vcg/complex/trimesh/platonic.h index 75064510..2c50bc95 100644 --- a/vcg/complex/trimesh/platonic.h +++ b/vcg/complex/trimesh/platonic.h @@ -1,4 +1,4 @@ -/**************************************************************************** +/*************************************************************************** * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.2 2004/03/03 16:11:46 cignoni +First working version (tetrahedron!) + ****************************************************************************/ @@ -38,19 +41,22 @@ namespace tri { template void Tetrahedron(MESH_TYPE &in) { + typedef typename MESH_TYPE::VertexPointer VertexPointer; + typedef typename MESH_TYPE::VertexIterator VertexIterator; + typedef typename MESH_TYPE::FaceIterator FaceIterator; + in.Clear(); Allocator::AddVertices(in,4); Allocator::AddFaces(in,4); - MESH_TYPE::VertexPointer ivp[4]; - - MESH_TYPE::VertexIterator vi=in.vert.begin(); + VertexPointer ivp[4]; + VertexIterator vi=in.vert.begin(); ivp[0]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 1, 1, 1); ++vi; ivp[1]=&*vi;(*vi).P()=MESH_TYPE::CoordType (-1, 1,-1); ++vi; ivp[2]=&*vi;(*vi).P()=MESH_TYPE::CoordType (-1,-1, 1); ++vi; ivp[3]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 1,-1,-1); - MESH_TYPE::FaceIterator fi=in.face.begin(); + FaceIterator fi=in.face.begin(); (*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[1]; (*fi).V(2)=ivp[2]; ++fi; (*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[2]; (*fi).V(2)=ivp[3]; ++fi; (*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[3]; (*fi).V(2)=ivp[1]; ++fi; @@ -60,35 +66,34 @@ void Tetrahedron(MESH_TYPE &in) template void Octahedron(MESH_TYPE &in) { - in.vn=6; - in.fn=8; - in.vert.clear(); - in.face.clear(); - MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0; + typedef typename MESH_TYPE::VertexPointer VertexPointer; + typedef typename MESH_TYPE::VertexIterator VertexIterator; + typedef typename MESH_TYPE::FaceIterator FaceIterator; + + in.Clear(); + Allocator::AddVertices(in,6); + Allocator::AddFaces(in,8); + + MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0; MESH_TYPE::CoordType tp; - tp=MESH_TYPE::CoordType ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv); - tp=MESH_TYPE::CoordType ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv); - tp=MESH_TYPE::CoordType ( 0, 0, 1); tv.P()=tp; in.vert.push_back(tv); - tp=MESH_TYPE::CoordType (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv); - tp=MESH_TYPE::CoordType ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv); - tp=MESH_TYPE::CoordType ( 0, 0,-1); tv.P()=tp; in.vert.push_back(tv); + VertexPointer ivp[4]; + VertexIterator vi=in.vert.begin(); + ivp[0]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 1, 0, 0); ++vi; + ivp[1]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 0, 1, 0); ++vi; + ivp[2]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 0, 0, 1); ++vi; + ivp[3]=&*vi;(*vi).P()=MESH_TYPE::CoordType (-1, 0, 0); ++vi; + ivp[4]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 0,-1, 0); ++vi; + ivp[5]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 0, 0,-1); - vector index(in.vn); - - MESH_TYPE::face_type f;f.Supervisor_Flags()=0; - - MESH_TYPE::vertex_iterator vi; - int j; - for(j=0,vi=in.vert.begin();j