Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gmtl::Vec 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:

Inheritance graph
[legend]
Collaboration diagram for gmtl::Vec:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DATA_TYPE DataType
 The datatype used for the components of this Vec. More...

typedef VecBase< DATA_TYPE,
SIZE > 
BaseType
 The superclass type. More...

enum  Params { Size = SIZE }
 The number of components this Vec has. More...


Public Methods

 Vec ()
 Default constructor. More...

Value constructors
 Vec (const Vec< DATA_TYPE, SIZE > &rVec)
 Make an exact copy of the given Vec object. More...

 Vec (const VecBase< DATA_TYPE, SIZE > &rVec)
 Make an exact copy of the given Vec object. More...

 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1)
 Creates a new Vec initialized to the given values. More...

 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2)
 Make an exact copy of the given Vec object. More...

 Vec (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2, const DATA_TYPE &val3)
 Make an exact copy of the given Vec object. More...


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 56 of file Vec.h.


Member Typedef Documentation

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

The superclass type.

Definition at line 66 of file Vec.h.

Referenced by gmtl::Vec< DATA_TYPE, 4 >::Vec.

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

The datatype used for the components of this Vec.

Reimplemented from gmtl::VecBase.

Definition at line 60 of file Vec.h.


Member Enumeration Documentation

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

The number of components this Vec has.

Enumeration values:
Size 

Reimplemented from gmtl::VecBase.

Definition at line 63 of file Vec.h.

00063 { 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 72 of file Vec.h.

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

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec const Vec< DATA_TYPE, SIZE > &    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 85 of file Vec.h.

00086       : BaseType( static_cast<BaseType>( rVec ) )
00087    {
00088    }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Vec< DATA_TYPE, SIZE >::Vec const VecBase< DATA_TYPE, SIZE > &    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 90 of file Vec.h.

00091       : BaseType( rVec )
00092    {
00093    }

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 98 of file Vec.h.

00099    : BaseType(val0, val1)
00100    {
00101       // @todo compile time assert is needed here
00102       gmtlASSERT( SIZE == 2 && "out of bounds element access in Point" );
00103    }

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]
 

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 105 of file Vec.h.

00106    : BaseType(val0, val1, val2)
00107    {
00108       // @todo compile time assert is needed here
00109       gmtlASSERT( SIZE == 3 && "out of bounds element access in Point" );
00110    }

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]
 

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 112 of file Vec.h.

00113    : BaseType(val0, val1, val2, val3)
00114    {
00115       // @todo compile time assert is needed here
00116       gmtlASSERT( SIZE == 4 && "out of bounds element access in Point" );
00117    }


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 15:29:32 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002