Public Types | Public Member Functions

gmtl::Vec< DATA_TYPE, SIZE > Class Template Reference
[Abstract Data Types: Matrix, Vec, Quat, Coord, Sphere, Plane]

A representation of a vector with SIZE components using DATA_TYPE as the data type for each component. More...

#include <Vec.h>

Inheritance diagram for gmtl::Vec< DATA_TYPE, SIZE >:
Inheritance graph
[legend]
Collaboration diagram for gmtl::Vec< DATA_TYPE, SIZE >:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Params { Size = SIZE }
 

The number of components this Vec has.

More...
typedef DATA_TYPE DataType
 The datatype used for the components of this Vec.
typedef VecBase< DATA_TYPE, SIZE > BaseType
 The superclass type.
typedef Vec< DATA_TYPE, SIZE > VecType

Public Member Functions

 Vec ()
 Default constructor.
template<typename REP2 >
VecTypeoperator= (const VecBase< DATA_TYPE, SIZE, REP2 > &rhs)
 Assign from different rep.
Value constructors

template<typename REP2 >
 Vec (const VecBase< DATA_TYPE, SIZE, REP2 > &rVec)
 Make an exact copy of the given Vec object.
 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1)
 Creates a new Vec initialized to the given values.
 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2)
 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2, const DATA_TYPE &val3)

Detailed Description

template<class DATA_TYPE, unsigned SIZE>
class gmtl::Vec< DATA_TYPE, SIZE >

A representation of a vector with SIZE components using DATA_TYPE as the data type for each component.

Parameters:
DATA_TYPE the datatype to use for the components
SIZE the number of components this VecBase has
See also:
Vec3f
Vec4f
Vec3d
Vec4f

Definition at line 33 of file Vec.h.


Member Typedef Documentation

template<class DATA_TYPE, unsigned SIZE>
typedef VecBase<DATA_TYPE, SIZE> gmtl::Vec< DATA_TYPE, SIZE >::BaseType

The superclass type.

Definition at line 44 of file Vec.h.

template<class DATA_TYPE, unsigned SIZE>
typedef DATA_TYPE gmtl::Vec< DATA_TYPE, SIZE >::DataType

The datatype used for the components of this Vec.

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE, meta::DefaultVecTag >.

Definition at line 38 of file Vec.h.

template<class DATA_TYPE, unsigned SIZE>
typedef Vec<DATA_TYPE, SIZE> gmtl::Vec< DATA_TYPE, SIZE >::VecType

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE, meta::DefaultVecTag >.

Definition at line 45 of file Vec.h.


Member Enumeration Documentation

template<class DATA_TYPE, unsigned SIZE>
enum gmtl::Vec::Params

The number of components this Vec has.

Enumerator:
Size 

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE, meta::DefaultVecTag >.

Definition at line 41 of file Vec.h.

{ Size = SIZE };


Constructor & Destructor Documentation

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec (  )  [inline]

Default constructor.

All components are initialized to zero.

Definition at line 51 of file Vec.h.

   {
      for (unsigned i = 0; i < SIZE; ++i)
         this->mData[i] = (DATA_TYPE)0;
   }

template<class DATA_TYPE, unsigned SIZE>
template<typename REP2 >
gmtl::Vec< DATA_TYPE, SIZE >::Vec ( const VecBase< DATA_TYPE, SIZE, REP2 > &  rVec  )  [inline]

Make an exact copy of the given Vec object.

Precondition:
Vector should be the same size and type as the one copied
Parameters:
rVec the Vec object to copy

Definition at line 77 of file Vec.h.

      : BaseType( rVec )
   {
   }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec ( const DATA_TYPE &  val0,
const DATA_TYPE &  val1 
) [inline]

Creates a new Vec initialized to the given values.

Definition at line 86 of file Vec.h.

   : BaseType(val0, val1)
   {
      GMTL_STATIC_ASSERT( SIZE == 2, Out_Of_Bounds_Element_Access_In_Vec );
   }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec ( const DATA_TYPE &  val0,
const DATA_TYPE &  val1,
const DATA_TYPE &  val2 
) [inline]

Definition at line 92 of file Vec.h.

   : BaseType(val0, val1, val2)
   {
      GMTL_STATIC_ASSERT( SIZE == 3, Out_Of_Bounds_Element_Access_In_Vec );
   }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec ( const DATA_TYPE &  val0,
const DATA_TYPE &  val1,
const DATA_TYPE &  val2,
const DATA_TYPE &  val3 
) [inline]

Definition at line 98 of file Vec.h.

   : BaseType(val0, val1, val2, val3)
   {
      GMTL_STATIC_ASSERT( SIZE == 4, Out_Of_Bounds_Element_Access_In_Vec );
   }


Member Function Documentation

template<class DATA_TYPE, unsigned SIZE>
template<typename REP2 >
VecType& gmtl::Vec< DATA_TYPE, SIZE >::operator= ( const VecBase< DATA_TYPE, SIZE, REP2 > &  rhs  )  [inline]

Assign from different rep.

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE, meta::DefaultVecTag >.

Definition at line 114 of file Vec.h.

   {
      BaseType::operator=(rhs);
      return *this;
   }


The documentation for this class was generated from the following file: