diff --git a/vcg/space/texcoord2.h b/vcg/space/texcoord2.h index 2261f675..dfcff174 100644 --- a/vcg/space/texcoord2.h +++ b/vcg/space/texcoord2.h @@ -31,9 +31,16 @@ namespace vcg { /*@{*/ /** - Templated class for a set of 2D texture coord. It for each is templated over two parameters: - the type of the tex coord and the number of texcoord to be stored. This class is intended to be used when many textures - id are shared over the same surface, so for each coord the id of the texture is stored. If no id is needed see the vcg::TexCoord2Simple class. + \brief Templated class for a storing a set of 2D texture coord plus their texture id. + + This class is templated over two parameters: + - the type of the texture coord and + - the number of texcoord to be stored. This is useful when you have multiple + coordinate set for the same entity (e.g. when you have two completely different + parametrizations over the same surface); + +This class is intended to be used when multiple textures id are shared over the same surface. +so for each coord the id of the texture is stored. If no texture id is needed see the vcg::TexCoord2Simple class. */ template @@ -49,29 +56,35 @@ private: short _n[NMAX]; public: - TexCoord2(T u, T v) { if(NMAX>0) _n[0]=0; _t[0][0]=u; _t[0][1]=v; }; - TexCoord2() { }; + TexCoord2(T u, T v) { if(NMAX>0) _n[0]=0; _t[0][0]=u; _t[0][1]=v; } + TexCoord2() { } - inline const PointType &P() const { return _t[0]; }; - inline PointType &P() { return _t[0]; }; + inline const PointType &P() const { return _t[0]; } + inline PointType &P() { return _t[0]; } - inline const PointType &P(const int i) const { assert(i>0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i0 && i (lowercase ones). DEPRECATED. TO BE REMOVED SOON.*/ @@ -79,39 +92,39 @@ public: /**/inline T & v() { return _t[0][1]; } /**/inline const T & u() const { return _t[0][0]; } /**/inline const T & v() const { return _t[0][1]; } - /**/inline T & u(const int i) { return _t[i][0]; } - /**/inline T & v(const int i) { return _t[i][1]; } - /**/inline const T & u(const int i) const { return _t[i][0]; } - /**/inline const T & v(const int i) const { return _t[i][1]; } + /**/inline T & u( int i) { return _t[i][0]; } + /**/inline T & v( int i) { return _t[i][1]; } + /**/inline const T & u( int i) const { return _t[i][0]; } + /**/inline const T & v( int i) const { return _t[i][1]; } /**/ /**/inline short & n() { return _n[0]; } /**/inline short n() const { return _n[0]; } /**/ - /**/inline short & n(const int i) { return _n[i]; } - /**/inline short n(const int i) const { return _n[i]; } + /**/inline short & n( int i) { return _n[i]; } + /**/inline short n( int i) const { return _n[i]; } /**/ - /**/inline Point2 & t(const int i) { return _t[i]; } - /**/inline Point2 t(const int i) const { return _t[i]; } + /**/inline Point2 & t( int i) { return _t[i]; } + /**/inline Point2 t( int i) const { return _t[i]; } /**/ /**/inline Point2 & t() { return _t[0]; } /**/inline Point2 t() const { return _t[0]; } /* */ - inline bool operator == ( TexCoord2 const & p ) const + inline bool operator == ( const TexCoord2 & p ) const { for(int i=0;i