diff --git a/vcg/simplex/faceplus/base.h b/vcg/simplex/faceplus/base.h index 1271e507..8fd3ca8b 100644 --- a/vcg/simplex/faceplus/base.h +++ b/vcg/simplex/faceplus/base.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.8 2006/10/09 20:20:18 cignoni +Increased the maximum number of possible template args from 8 to 9 + Revision 1.7 2006/02/27 17:58:11 ponchio Added some documentation @@ -82,6 +85,7 @@ class FaceTypeHolder{ typedef BET *EdgePointer; typedef BFT *FacePointer; typedef BTT *TetraPointer; + static void Name(std::vector & name){} // prot diff --git a/vcg/simplex/faceplus/component.h b/vcg/simplex/faceplus/component.h index 71161fb1..e4b0e9f0 100644 --- a/vcg/simplex/faceplus/component.h +++ b/vcg/simplex/faceplus/component.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.12 2007/01/11 10:22:39 cignoni +Added intialization of vertexRef to 0. + Revision 1.11 2006/12/06 00:08:57 cignoni Added FFp1 and FFp2 shortcuts @@ -64,6 +67,7 @@ First Really Working version #ifndef __VCG_FACE_PLUS_COMPONENT #define __VCG_FACE_PLUS_COMPONENT +#include #include namespace vcg { @@ -85,7 +89,8 @@ public: inline typename T::CoordType & P( const int j ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType & P( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType &cP( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } - static bool HasVertexRef() { return false; } + static bool HasVertexRef() { return false; } + static void Name(std::vector & name){T::Name(name);} }; template class VertexRef: public T { @@ -132,6 +137,8 @@ public: inline typename T::VertexType * & UberV( const int j ) { assert(j>=0 && j<3); return v[j]; } inline const typename T::VertexType * const & UberV( const int j ) const { assert(j>=0 && j<3); return v[j]; } static bool HasVertexRef() { return true; } + static void Name(std::vector & name){name.push_back(std::string("VertexRef"));T::Name(name);} + private: typename T::VertexType *v[3]; @@ -156,6 +163,7 @@ public: static bool HasFaceNormalOcc() { return false; } // void ComputeNormal() {assert(0);} // void ComputeNormalizedNormal() {assert(0);} + static void Name(std::vector & name){ T::Name(name);} }; template class NormalFromVert: public T { @@ -166,6 +174,7 @@ public: static bool HasFaceNormal() { return true; } // void ComputeNormal() { _norm = vcg::Normal(*(static_cast(this))); } // void ComputeNormalizedNormal() { _norm = vcg::NormalizedNormal(*this);} + static void Name(std::vector & name){name.push_back(std::string("NormalFromVert"));T::Name(name);} private: NormalType _norm; @@ -184,7 +193,8 @@ public: NormalType &N() { return _norm; } NormalType cN() const { return _norm; } static bool HasFaceNormal() { return true; } - + static void Name(std::vector & name){name.push_back(std::string("NormalAbs"));T::Name(name);} + private: NormalType _norm; }; @@ -195,15 +205,22 @@ public: NormalType &WN(const int j) { return _wnorm[j]; } const NormalType cWN(const int j) const { return _wnorm[j]; } static bool HasWedgeNormal() { return true; } + static void Name(std::vector & name){name.push_back(std::string("WedgeNormal"));T::Name(name);} private: NormalType _wnorm[3]; }; -template class Normal3s: public NormalAbs {}; -template class Normal3f: public NormalAbs {}; -template class Normal3d: public NormalAbs {}; +template class Normal3s: public NormalAbs { +public:static void Name(std::vector & name){name.push_back(std::string("Normal3s"));T::Name(name);} +}; +template class Normal3f: public NormalAbs { +public: static void Name(std::vector & name){name.push_back(std::string("Normal3f"));T::Name(name);} +}; +template class Normal3d: public NormalAbs { +public: static void Name(std::vector & name){name.push_back(std::string("Normal3d"));T::Name(name);} +}; /*-------------------------- Texture ----------------------------------------*/ @@ -216,6 +233,7 @@ public: TexCoordType const &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;} static bool HasWedgeTexture() { return false; } static bool HasWedgeTextureOcc() { return false; } + static void Name(std::vector & name){TT::Name(name);} }; template class WedgeTexture: public TT { @@ -225,14 +243,21 @@ public: TexCoordType &WT(const int i) { return _wt[i]; } TexCoordType const &cWT(const int i) const { return _wt[i]; } static bool HasWedgeTexture() { return true; } + static void Name(std::vector & name){name.push_back(std::string("WedgeTexture"));TT::Name(name);} private: TexCoordType _wt[3]; }; -template class WedgeTexture2s: public WedgeTexture, TT> {}; -template class WedgeTexture2f: public WedgeTexture, TT> {}; -template class WedgeTexture2d: public WedgeTexture, TT> {}; +template class WedgeTexture2s: public WedgeTexture, TT> { +public: static void Name(std::vector & name){name.push_back(std::string("WedgeTexture2s"));TT::Name(name);} +}; +template class WedgeTexture2f: public WedgeTexture, TT> { +public: static void Name(std::vector & name){name.push_back(std::string("WedgeTexture2f"));TT::Name(name);} +}; +template class WedgeTexture2d: public WedgeTexture, TT> { +public: static void Name(std::vector & name){name.push_back(std::string("WedgeTexture2d"));TT::Name(name);} +}; /*------------------------- FLAGS -----------------------------------------*/ template class EmptyBitFlags: public T { @@ -242,6 +267,8 @@ public: const int Flags() const { return 0; } static bool HasFlags() { return false; } static bool HasFlagsOcc() { return false; } + static void Name(std::vector & name){T::Name(name);} + }; template class BitFlags: public T { @@ -250,6 +277,7 @@ public: int &Flags() {return _flags; } const int Flags() const {return _flags; } static bool HasFlags() { return true; } + static void Name(std::vector & name){name.push_back(std::string("BitFlags"));T::Name(name);} private: @@ -269,6 +297,8 @@ public: static bool HasWedgeColor() { return false; } static bool HasFaceQuality() { return false; } static bool HasFaceColorOcc() { return false;} + static void Name(std::vector & name){T::Name(name);} + }; template class Color: public T { public: @@ -276,6 +306,8 @@ public: Color():_color(vcg::Color4b::White) {} ColorType &C() { return _color; } static bool HasFaceColor() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Color"));T::Name(name);} + private: ColorType _color; }; @@ -285,16 +317,22 @@ public: typedef A ColorType; ColorType &WC(const int i) { return _color[i]; } static bool HasFaceColor() { return true; } + static void Name(std::vector & name){name.push_back(std::string("WedgeColor"));T::Name(name);} + private: ColorType _color[3]; }; -template class Color4b: public Color {}; +template class Color4b: public Color { + static void Name(std::vector & name){name.push_back(std::string("Color4b"));T::Name(name);} +}; /*-------------------------- Quality ----------------------------------*/ template class EmptyQuality: public T { public: + static void Name(std::vector & name){T::Name(name);} + }; template class Quality: public T { public: @@ -302,14 +340,20 @@ public: QualityType &Q() { return _quality; } static bool HasFaceQuality() { return true; } static bool HasFaceQualityOcc() { return true; } - + static void Name(std::vector & name){name.push_back(std::string("Quality"));T::Name(name);} private: QualityType _quality; }; -template class Qualitys: public Quality {}; -template class Qualityf: public Quality {}; -template class Qualityd: public Quality {}; +template class Qualitys: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualitys"));T::Name(name);} +}; +template class Qualityf: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualityf"));T::Name(name);} +}; +template class Qualityd: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualityd"));T::Name(name);} +}; /*-------------------------- INCREMENTAL MARK ----------------------------------------*/ template class EmptyMark: public T { @@ -320,6 +364,7 @@ public: inline void InitIMark() { } inline int & IMark() { assert(0); static int tmp=-1; return tmp;} inline const int IMark() const {return 0;} + static void Name(std::vector & name){T::Name(name);} }; template class Mark: public T { @@ -329,6 +374,7 @@ public: inline void InitIMark() { _imark = 0; } inline int & IMark() { return _imark;} inline const int & IMark() const {return _imark;} + static void Name(std::vector & name){name.push_back(std::string("Mark"));T::Name(name);} private: int _imark; @@ -351,6 +397,8 @@ public: static bool HasFFAdjacency() { return false; } static bool HasFFAdjacencyOcc() { return false; } static bool HasVFAdjacencyOcc() { return false; } + static void Name(std::vector & name){T::Name(name);} + }; template class VFAdj: public T { @@ -362,6 +410,8 @@ public: char &VFi(const int j) {return _vfi[j]; } static bool HasVFAdjacency() { return true; } static bool HasVFAdjacencyOcc() { return false; } + static void Name(std::vector & name){name.push_back(std::string("VFAdj"));T::Name(name);} + private: typename T::FacePointer _vfp[3] ; char _vfi[3] ; @@ -389,6 +439,7 @@ public: static bool HasFFAdjacency() { return true; } static bool HasFFAdjacencyOcc() { return false; } + static void Name(std::vector & name){name.push_back(std::string("FFAdj"));T::Name(name);} private: typename T::FacePointer _ffp[3] ;