/**************************************************************************** * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * * Copyright(C) 2004 \/)\/ * * Visual Computing Lab /\/| * * ISTI - Italian National Research Council | * * \ * * All rights reserved. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * ****************************************************************************/ /**************************************************************************** History $Log: not supported by cvs2svn $ Revision 1.1 2005/10/15 16:24:10 ganovelli Working release (compilata solo su MSVC), component_occ è migrato da component_opt ****************************************************************************/ #ifndef __VCG_VERTEX_PLUS_COMPONENT_OCC #define __VCG_VERTEX_PLUS_COMPONENT_OCC #include #include namespace vcg { namespace vert { /* Some naming Rules All the Components that can be added to a vertex should be defined in the namespace vert: */ /*------------------------- COORD -----------------------------------------*/ template class CoordOcc: public T { public: typedef A CoordType; typedef typename CoordType::ScalarType ScalarType; CoordType &P() { return CAT< vector_occ,CoordType>::Instance()->Get((VertType*)this); } CoordType &UberP() { return CAT< vector_occ,CoordType>::Instance()->Get((VertType*)this); } }; template class Coord3fOcc: public CoordOcc {}; template class Coord3dOcc: public CoordOcc {}; /*-------------------------- NORMAL ----------------------------------------*/ template class NormalOcc: public T { public: typedef A NormalType; NormalType &N() {return CAT< vector_occ,NormalType>::Instance()->Get((VertType*)this); } /*private: NormalType _norm; */ }; template class Normal3sOcc: public NormalOcc {}; template class Normal3fOcc: public NormalOcc {}; template class Normal3dOcc: public NormalOcc {}; /*-------------------------- TEXCOORD ----------------------------------------*/ template class TexCoordOcc: public T { public: typedef A TexCoordType; TexCoordType &T() {return CAT< vector_occ,TexCoordType>::Instance()->Get((VertType*)this); } static bool HasTexCoord() { return true; } /* private: TexCoordType _t; */ }; template class TexCoord2sOcc: public TexCoordOcc, T> {}; template class TexCoord2fOcc: public TexCoordOcc, T> {}; template class TexCoord2dOcc: public TexCoordOcc, T> {}; ///*------------------------- FLAGS -----------------------------------------*/ template class FlagOcc: public T { public: int &Flags() {return CAT< vector_occ,int>::Instance()->Get((VertType*)this); } const int Flags() const {return _flags; } /* private: int _flags; */ }; ///*-------------------------- COLOR ----------------------------------*/ template class ColorOcc: public T { public: typedef A ColorType; ColorType &C() { return CAT< vector_occ,ColorType>::Instance()->Get((VertType*)this); } static bool HasColor() { return true; } /*private: ColorType _color; */ }; template class Color4bOcc: public ColorOcc {}; ///*-------------------------- Quality ----------------------------------*/ template class QualityOcc: public T { public: typedef A QualityType; QualityType &Q() { return CAT< vector_occ,QualityType>::Instance()->Get((VertType*)this);} static bool HasQuality() { return true; } /*private: QualityType _quality; */ }; template class QualitysOcc: public QualityOcc {}; template class QualityfOcc: public QualityOcc {}; template class QualitydOcc: public QualityOcc {}; // ///*----------------------------- VFADJ ------------------------------*/ template class VFAdjOcc: public T { public: typename T::FacePointer &Fp() {return CAT< vector_occ,T::FacePointer>::Instance()->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 #endif