From 0ede25d91c8b7dd67b3176f14a9c99cafe43b9f0 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Wed, 31 Mar 2004 22:32:31 +0000 Subject: [PATCH] First working release --- vcg/simplex/vertexplus/component_opt.h | 79 ++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/vcg/simplex/vertexplus/component_opt.h b/vcg/simplex/vertexplus/component_opt.h index 95ae3d2d..e367460a 100644 --- a/vcg/simplex/vertexplus/component_opt.h +++ b/vcg/simplex/vertexplus/component_opt.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.3 2004/03/31 14:16:40 ganovelli +Data structure to handle temporary attributes. First version + Revision 1.2 2004/03/31 13:15:28 cignoni Added optional cpmponent @@ -61,18 +64,86 @@ template class Coord3dOpt: public CoordOpt {}; /*-------------------------- NORMAL ----------------------------------------*/ + +template class NormalOpt: public T { +public: + typedef A NormalType; + NormalType &N() {return CAT< TVector,NormalType>::Get((VertType*)this); } +private: + NormalType _norm; +}; + +template class Normal3sOpt: public NormalOpt {}; +template class Normal3fOpt: public NormalOpt {}; +template class Normal3dOpt: public NormalOpt {}; + /*-------------------------- TEXTURE ----------------------------------------*/ -/*------------------------- FLAGS -----------------------------------------*/ +template class TextureOpt: public T { +public: + typedef A TextureType; + TextureType &T() {return CAT< TVector,TextureType>::Get((VertType*)this); } + static bool HasTexture() { return true; } -/*-------------------------- COLOR ----------------------------------*/ +private: + TextureType _t; +}; +template class Texture2sOpt: public TextureOpt, T> {}; +template class Texture2fOpt: public TextureOpt, T> {}; +template class Texture2dOpt: public TextureOpt, T> {}; -/*-------------------------- Quality ----------------------------------*/ +///*------------------------- FLAGS -----------------------------------------*/ +template class FlagOpt: public T { +public: + int &Flags() {return CAT< TVector,int>::Get((VertType*)this); } + const int Flags() const {return _flags; } -/*----------------------------- VFADJ ------------------------------*/ +private: + int _flags; +}; +///*-------------------------- COLOR ----------------------------------*/ + +template class ColorOpt: public T { +public: + typedef A ColorType; + ColorType &C() { return CAT< TVector,ColorType>::Get((VertType*)this); } + static bool HasColor() { return true; } +private: + ColorType _color; +}; + +template class Color4bOpt: public ColorOpt {}; + +///*-------------------------- Quality ----------------------------------*/ + +template class QualityOpt: public T { +public: + typedef A QualityType; + QualityType &Q() { return CAT< TVector,QualityType>::Get((VertType*)this);} + static bool HasQuality() { return true; } + +private: + QualityType _quality; +}; + +template class QualitysOpt: public QualityOpt {}; +template class QualityfOpt: public QualityOpt {}; +template class QualitydOpt: public QualityOpt {}; +// +///*----------------------------- VFADJ ------------------------------*/ + +template class VFAdjOpt: public T { +public: + typename T::FacePointer &Fp() {return CAT< TVector,T::FacePointer>::Get((VertType*)this); } + int &Zp() {return _zp; } + static bool HasVFAdjacency() { return true; } +private: + typename T::FacePointer _fp ; + int _zp ; +}; } // end namespace vert }// end namespace vcg