Edited doxygen comments

This commit is contained in:
Paolo Cignoni 2004-02-09 13:48:02 +00:00
parent ea0cf9013d
commit c6ba9e39cc
1 changed files with 41 additions and 21 deletions

View File

@ -18,8 +18,11 @@
*****************************************************************************/ *****************************************************************************/
/*#************************************************************************** /*#**************************************************************************
History History
$Id: point3.h,v 1.3 2004-02-06 02:25:54 cignoni Exp $ $Id: point3.h,v 1.4 2004-02-09 13:48:02 cignoni Exp $
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.3 2004/02/06 02:25:54 cignoni
First working release.
Revision 1.2 2004/02/06 02:17:09 cignoni Revision 1.2 2004/02/06 02:17:09 cignoni
First commit... First commit...
@ -35,20 +38,27 @@ First commit...
namespace vcg { namespace vcg {
/** The class for representing a 3D point /** The templated class for representing a point in 3D space.
* More details about this class. * The class is templated over the scalar value representing coordinates.
*/ */
template <class T> class Point3 template <class T> class Point3
{ {
protected: protected:
/// The only data member. Hidden to user.
T _v[3]; T _v[3];
public: public:
typedef T scalar; typedef T scalar;
// Costruttori & assegnatori
//@{
/** @name Standard Constructors and Initializer.
No casting operators have been introduced to avoid automatic unattended (and costly) conversion between different point types
**/
inline Point3 () { } inline Point3 () { }
inline Point3 ( const T nx, const T ny, const T nz ) inline Point3 ( const T nx, const T ny, const T nz )
{ {
@ -79,6 +89,31 @@ public:
_v[1] = 0; _v[1] = 0;
_v[2] = 0; _v[2] = 0;
} }
/// Questa funzione estende il vettore ad un qualsiasi numero di dimensioni
/// paddando gli elementi estesi con zeri
inline T Ext( const int i ) const
{
if(i>=0 && i<=2) return _v[i];
else return 0;
}
template <class Q>
inline void Import( const Point3<Q> & b )
{
_v[0] = T(b[0]);
_v[1] = T(b[1]);
_v[2] = T(b[2]);
}
template <class Q>
static inline Point3 Construct( const Point3<Q> & b )
{
return Point3(T(b[0]),T(b[1]),T(b[2]));
}
//@}
// Accesso alle componenti // Accesso alle componenti
inline const T &x() const { return _v[0]; } inline const T &x() const { return _v[0]; }
inline const T &y() const { return _v[1]; } inline const T &y() const { return _v[1]; }
@ -245,21 +280,6 @@ public:
(_v[0]>=p._v[0]); (_v[0]>=p._v[0]);
} }
/// Questa funzione estende il vettore ad un qualsiasi numero di dimensioni
/// paddando gli elementi estesi con zeri
inline T Ext( const int i ) const
{
if(i>=0 && i<=2) return _v[i];
else return 0;
}
template <class Q>
inline void Import( const Point3<Q> & b )
{
_v[0] = T(b[0]);
_v[1] = T(b[1]);
_v[2] = T(b[2]);
}
inline Point3 operator - () const inline Point3 operator - () const
{ {