SGE::CLT_Vector< TType > Class Template Reference

The class is a template class to create vectors from 2 dimensions to 4 dimensions(and more if required) of any type(float, int, double,...). It has XML support to load/save the vectors from/to XML files. More...

#include <cl_vectors_template.h>

Inheritance diagram for SGE::CLT_Vector< TType >:

Inheritance graph
[legend]
Collaboration diagram for SGE::CLT_Vector< TType >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef int VectorDimType

Public Member Functions

_SG_TLS_INLINE CLT_Vector (const CLT_Vector< TType > &_Vec)
 Copy Constructor.
template<typename TType2>
 CLT_Vector (const CLT_Vector< TType2 > &_Vec)
 Copy Constructor for different CLT_Vector template types. Ex: Allow casting from 'int' vector to 'float' vector.
_SG_TLS_INLINE CLT_Vector (const int _VectorDim, const TType *_Val)
 Constructor, set the vector with _Val array.
_SG_TLS_INLINE CLT_Vector (const int _VectorDim, const TType _Val)
 Constructor, set the vector will _Val.
_SG_TLS_INLINE ~CLT_Vector ()
 Default destructor, destroy the vector data table.
_SG_TLS_INLINE void Clear (int _Dim=-1)
 Affect the vector array if _Dim and Clear the vector. If the vector dimension has not been defined yet, it wiil be set to _Dim. Else it only clear the vector.
_SG_TLS_INLINE float Length ()
 Normalize the vector so that it has length unity.
_SG_TLS_INLINE float Normalize (TType _unit=1)
_SG_TLS_INLINE TType GetVal (const int _index)
_SG_TLS_INLINE TType * GetPtr (const int _index)
_SG_TLS_INLINE int GetDim () const
_SG_TLS_INLINE TType & operator[] (const int _index)
 Get a reference to the given axe value.
_SG_TLS_INLINE TType operator[] (const int _index) const
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator+= (const CLT_Vector< TType > &_Vec)
 += operator using an other CLT_Vector.
_SG_TLS_INLINE CLT_Vector<
TType > 
operator+ (const CLT_Vector< TType > &_Vec) const
 + operator using a CLT_Vector.
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator+= (const TType _Val)
 += operator using a TType value.
_SG_TLS_INLINE CLT_Vector<
TType > 
operator+ (const TType _Val) const
 + operator using a TType value.
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator-= (const CLT_Vector &_Vec)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator- (const CLT_Vector &_Vec) const
_SG_TLS_INLINE CLT_Vector<
TType > 
operator- () const
 Return the current vector multipliied (-1).
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator-= (const TType _Val)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator- (const TType _Val) const
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator/= (const CLT_Vector< TType > &_Vec)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator/ (const CLT_Vector< TType > &_Vec)
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator/= (const TType _Val)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator/ (const TType _Val) const
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator *= (const CLT_Vector< TType > &_Vec)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator * (const CLT_Vector< TType > &_Vec) const
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator *= (const TType _Val)
_SG_TLS_INLINE CLT_Vector<
TType > 
operator * (const TType _Val) const
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator= (const CLT_Vector< TType > &_Vec)
 operator = with other CLT_Vector<TType>.
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator= (const TType _f)
 operator = with TType _f. All the vector dimension will be set to _f value.
_SG_TLS_INLINE CLT_Vector<
TType > & 
operator= (const TType *_f)
 operator = with TType *_f. All the vector dimension will be set to _f[] value.
_SG_TLS_INLINE bool operator== (const CLT_Vector< TType > &_Vec2)
_SG_TLS_INLINE bool operator!= (const CLT_Vector< TType > &_Vec2)
_SG_TLS_INLINE bool operator< (const CLT_Vector< TType > &_Vec2)
_SG_TLS_INLINE bool operator< (const TType _f)
_SG_TLS_INLINE bool operator< (const TType *_f)
_SG_TLS_INLINE bool operator> (const CLT_Vector< TType > &_Vec2)
_SG_TLS_INLINE bool operator> (const TType _f)
_SG_TLS_INLINE bool operator> (const TType *_f)
template<typename TType2>
CLT_Vector< TType > & operator= (CLT_Vector< TType2 > &_Vec2)

Public Attributes

TType * vec

Detailed Description

template<typename TType>
class SGE::CLT_Vector< TType >

The class is a template class to create vectors from 2 dimensions to 4 dimensions(and more if required) of any type(float, int, double,...). It has XML support to load/save the vectors from/to XML files.

Todo:
Finish documentation.
Note:
Author:
Yannouchka


Constructor & Destructor Documentation

template<typename TType>
SGE::CLT_Vector< TType >::CLT_Vector const CLT_Vector< TType > &  _Vec  ) 
 

Copy Constructor.

Parameters:
_Vec => Original vector to copy.
Returns:
Nothing

template<typename TType>
template<typename TType2>
SGE::CLT_Vector< TType >::CLT_Vector const CLT_Vector< TType2 > &  _Vec  ) 
 

Copy Constructor for different CLT_Vector template types. Ex: Allow casting from 'int' vector to 'float' vector.

Parameters:
_Vec => Original vector to copy of type TType2
Returns:
Nothing

template<typename TType>
SGE::CLT_Vector< TType >::CLT_Vector const int  _VectorDim,
const TType *  _Val
 

Constructor, set the vector with _Val array.

Parameters:
_Val => TType array, the array size must be >= to the vector dim.
Returns:
Nothing

template<typename TType>
SGE::CLT_Vector< TType >::CLT_Vector const int  _VectorDim,
const TType  _Val
 

Constructor, set the vector will _Val.

Parameters:
_Val => TType value, all the vector dimension are set to _Val.
Returns:
Nothing

template<typename TType>
SGE::CLT_Vector< TType >::~CLT_Vector  ) 
 

Default destructor, destroy the vector data table.

Returns:
Nothing


Member Function Documentation

template<typename TType>
void SGE::CLT_Vector< TType >::Clear int  _Dim = -1  ) 
 

Affect the vector array if _Dim and Clear the vector. If the vector dimension has not been defined yet, it wiil be set to _Dim. Else it only clear the vector.

Returns:
Nothing

template<typename TType>
int SGE::CLT_Vector< TType >::GetDim  )  const
 

Returns:
The vector dimension value.

template<typename TType>
float SGE::CLT_Vector< TType >::Length  ) 
 

Normalize the vector so that it has length unity.

Returns:
Length value.

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator * const TType  _Val  )  const
 

See also:
CLT_Vector<TType>::operator+(const TType)const

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator * const CLT_Vector< TType > &  _Vec  )  const
 

See also:
CLT_Vector<TType>::operator+(const CLT_Vector<TType> &)const

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator *= const CLT_Vector< TType > &  _Vec  ) 
 

See also:
CLT_Vector<TType>::operator+=(const CLT_Vector<TType> &)

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator+ const TType  _Val  )  const
 

+ operator using a TType value.

Parameters:
_Val => TType value to add to all vector dimensions.
Returns:
The resulted CLT_Vector.

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator+ const CLT_Vector< TType > &  _Vec  )  const
 

+ operator using a CLT_Vector.

Parameters:
_Vec => Vector to add.
Returns:
The resulted CLT_Vector.

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator+= const TType  _Val  ) 
 

+= operator using a TType value.

Parameters:
_Vec => TType value to add to all vector dimensions.
Returns:
Current CLT_Vector reference.

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator+= const CLT_Vector< TType > &  _Vec  ) 
 

+= operator using an other CLT_Vector.

Parameters:
_Vec => Vector to add.
Returns:
Current CLT_Vector reference.

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator- const TType  _Val  )  const
 

See also:
CLT_Vector<TType>::operator+(const TType)const

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator-  )  const
 

Return the current vector multipliied (-1).

Returns:
The resulted CLT_Vector.

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator-= const TType  _Val  ) 
 

See also:
CLT_Vector<TType>::operator+=(const TType)

template<typename TType>
CLT_Vector< TType > SGE::CLT_Vector< TType >::operator/ const TType  _Val  )  const
 

See also:
CLT_Vector<TType>::operator+(const TType)const

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator/= const TType  _Val  ) 
 

See also:
CLT_Vector<TType>::operator+=(const TType)

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator/= const CLT_Vector< TType > &  _Vec  ) 
 

See also:
CLT_Vector<TType>::operator+=(const CLT_Vector<TType> &)

template<typename TType>
CLT_Vector< TType > & SGE::CLT_Vector< TType >::operator= const TType *  _f  ) 
 

operator = with TType *_f. All the vector dimension will be set to _f[] value.

Note:
*_f must be an array of size >= to the vector dimension.

Reimplemented in SGE::CL_Vector2D< TType >, SGE::CL_Vector3D< TType >, and SGE::CL_Vector4D_Base< TType >.

template<typename TType>
TType & SGE::CLT_Vector< TType >::operator[] const int  _index  ) 
 

Get a reference to the given axe value.

Returns:
TType reference.


The documentation for this class was generated from the following file:
Generated on Mon Mar 19 23:15:16 2007 for SugoiTools by  doxygen 1.4.6-NO