From 9fc476b1302f44a3c4b9d4015770e14250cf2f4c Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 19 Mar 2010 17:18:00 +0000 Subject: [PATCH] added type traits to support the mod below: [ Changes in definition of TriMesh: PART II ] Note: No changes to existing code need be the done, this mod should be fully backward compatible Old way to define a TriMesh ============== struct MyMesh: public vcg::tri::TriMesh< vector , vector >{}; new ways to define a TriMesh ============== struct MyMesh: public vcg::tri::TriMesh< CONT1 >{}; struct MyMesh: public vcg::tri::TriMesh< CONT1 , CONT2>{}; struct MyMesh: public vcg::tri::TriMesh< CONT1 , CONT2, CONT3>{}; where CONT[i] can be vector< [MyVertex | MyEdge | MyFace ] > (the order is unimportant) --- vcg/simplex/vertex/base.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcg/simplex/vertex/base.h b/vcg/simplex/vertex/base.h index 8e03c5eb..bd74ce9c 100644 --- a/vcg/simplex/vertex/base.h +++ b/vcg/simplex/vertex/base.h @@ -72,6 +72,7 @@ First working version! #include #include #include +#include #include namespace vcg { @@ -139,7 +140,8 @@ class VertexArityMax: public Arity12, A, B, C, D, E // ----- Flags stuff ----- public: - + + enum { @@ -260,7 +262,8 @@ template class G = DefaultDeriver, template class H = DefaultDeriver, template class I = DefaultDeriver, template class J = DefaultDeriver, template class K = DefaultDeriver, template class L = DefaultDeriver> - class Vertex: public VertexArityMax {}; + class Vertex: public VertexArityMax { + public: typedef AllTypes::AVertexType IAm; typedef UserTypes TypesPool;}; }// end namespace #endif