From 6458dd30adad52efede9967599a2aed1c552e8b3 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 12 Nov 2014 00:19:18 +0000 Subject: [PATCH] Added some practical typedefs for simpler use of attributes --- vcg/complex/base.h | 12 ++++++++++++ vcg/complex/used_types.h | 1 + 2 files changed, 13 insertions(+) diff --git a/vcg/complex/base.h b/vcg/complex/base.h index 49f2ff88..814a9c60 100644 --- a/vcg/complex/base.h +++ b/vcg/complex/base.h @@ -264,6 +264,7 @@ class TriMesh PerVertexAttributeHandle( void *ah,const int & n):AttributeHandle(ah,n){} }; + template class PerFaceAttributeHandle: public AttributeHandle{ public: @@ -294,6 +295,17 @@ class TriMesh ATTR_TYPE & operator ()(){ return *((Attribute *)_handle)->attribute;} }; + // Some common Handle typedefs to simplify use + typedef typename MeshType::template PerVertexAttributeHandle PerVertexScalarHandle; + typedef typename MeshType::template PerVertexAttributeHandle PerVertexIntHandle; + typedef typename MeshType::template PerVertexAttributeHandle PerVertexBoolHandle; + typedef typename MeshType::template PerVertexAttributeHandle PerVertexCoordHandle; + + typedef typename MeshType::template PerFaceAttributeHandle PerFaceScalarHandle; + typedef typename MeshType::template PerFaceAttributeHandle PerFaceIntHandle; + typedef typename MeshType::template PerFaceAttributeHandle PerFaceBoolHandle; + typedef typename MeshType::template PerFaceAttributeHandle PerFaceCoordHandle; + // the camera member (that should keep the intrinsics) is no more needed since 2006, when intrisncs moved into the Shot structure //Camera camera; // intrinsic diff --git a/vcg/complex/used_types.h b/vcg/complex/used_types.h index a346636c..0109a2a5 100755 --- a/vcg/complex/used_types.h +++ b/vcg/complex/used_types.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include