From d0d2efa45447331e639a7ef404e7e9a27ccc024b Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 3 Sep 2010 22:17:14 +0000 Subject: [PATCH] removed the use of RTTI for checking the name of the attribute TYPE in the Get*Attribute. Now the check is only on the size of the type. --- vcg/complex/trimesh/allocate.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcg/complex/trimesh/allocate.h b/vcg/complex/trimesh/allocate.h index 8070d999..fc3538b3 100644 --- a/vcg/complex/trimesh/allocate.h +++ b/vcg/complex/trimesh/allocate.h @@ -794,7 +794,7 @@ public: i =m.vert_attr.find(h1); if(i!=m.vert_attr.end()) - if((*i)._typename == typeid(ATTR_TYPE).name() ){ + if((*i)._sizeof == sizeof(ATTR_TYPE) ){ if( (*i)._padding != 0 ){ PointerToAttribute attr = (*i); // copy the PointerToAttribute m.vert_attr.erase(i); // remove it from the set @@ -978,7 +978,7 @@ public: i =m.face_attr.find(h1); if(i!=m.face_attr.end()) - if((*i)._typename == typeid(ATTR_TYPE).name() ){ + if((*i)._sizeof == sizeof(ATTR_TYPE) ){ if( (*i)._padding != 0 ){ PointerToAttribute attr = (*i); // copy the PointerToAttribute m.face_attr.erase(i); // remove it from the set @@ -1064,7 +1064,7 @@ public: i =m.mesh_attr.find(h1); if(i!=m.mesh_attr.end()) - if((*i)._typename == typeid(ATTR_TYPE).name() ){ + if((*i)._sizeof == sizeof(ATTR_TYPE) ){ if( (*i)._padding != 0 ){ PointerToAttribute attr = (*i); // copy the PointerToAttribute m.mesh_attr.erase(i); // remove it from the set @@ -1084,7 +1084,7 @@ public: static void GetAllPerMeshAttribute(const MeshType & m, std::vector &all){ typename std::set :: iterator i; for(i = m.mesh_attr.begin(); i != m.mesh_attr.end(); ++i ) - if((*i)._typename == typeid(ATTR_TYPE).name()) + if((*i)._sizeof == sizeof(ATTR_TYPE)) all.push_back((*i)._name); }