separated alltypes from usedtypes. The dummy types for simplex where char, now are derived by

their proper type (eg. the dummy type for Vertex is a simple derivation of vcg::Vertex)
This commit is contained in:
ganovelli 2010-05-19 17:05:29 +00:00
parent 3ab37342c6
commit 6b807efa9c
2 changed files with 46 additions and 11 deletions

16
vcg/complex/all_types.h Executable file
View File

@ -0,0 +1,16 @@
#ifndef VCG_ALL_TYPES_H
#define VCG_ALL_TYPES_H
namespace vcg{
struct AllTypes{
struct AVertexType {};
struct AEdgeType {};
struct AFaceType {};
struct AHEdgeType {};
};
};
#endif // USED_TYPES_H

View File

@ -5,14 +5,26 @@
#include <vcg/space/point3.h>
#include <vcg/container/derivation_chain.h>
#include <vcg/simplex/vertex/base.h>
#include <vcg/simplex/face/base.h>
#include <vcg/simplex/edge/base.h>
#include <vcg/connectors/hedge.h>
namespace vcg{
// dummy mesh
struct _Vertex;
struct _Edge ;
struct _Face ;
struct _HEdge ;
struct DummyTypes{
typedef char VertexType; // simplex types
typedef char EdgeType;
typedef char FaceType;
typedef char TetraType;
typedef char HEdgeType; // connector types
typedef _Vertex VertexType; // simplex types
typedef _Edge EdgeType;
typedef _Face FaceType;
typedef char TetraType;
typedef _HEdge HEdgeType; // connector types
typedef vcg::Point3<bool> CoordType;
typedef char ScalarType;
@ -28,12 +40,6 @@ struct DummyTypes{
void ImportLocal(const LeftV & /*left*/ ) {}
};
struct AllTypes{
struct AVertexType {};
struct AEdgeType {};
struct AFaceType {};
struct AHEdgeType {};
};
template <template <typename> class A = DefaultDeriver, template <typename> class B = DefaultDeriver,
template <typename> class C = DefaultDeriver, template <typename> class D = DefaultDeriver,
@ -54,6 +60,19 @@ template <class A>
template <class T> struct AsHEdgeType: public T{typedef A HEdgeType; typedef HEdgeType * HEdgePointer ;};
};
struct _UsedTypes: public UsedTypes<
Use<_Vertex>::AsVertexType,
Use<_Edge >::AsEdgeType,
Use<_Face >::AsFaceType,
Use<_HEdge >::AsHEdgeType
>{};
struct _Vertex: public Vertex<_UsedTypes>{};
struct _Edge : public Edge<_UsedTypes>{};
struct _Face : public Face<_UsedTypes>{};
struct _HEdge : public HEdge<_UsedTypes>{};
};
#endif // USED_TYPES_H