TC::Math::Coord2D< T > Class Template Reference
[Mathematic]

Class for handling 2D values with implementation of all common operators needed. More...

#include <TCMathCoord2D.h>

Collaboration diagram for TC::Math::Coord2D< T >:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { NUM_COMPONENTS = 2 }
typedef T DataType

Public Member Functions

 Coord2D (T vIn=(T) 0)
 default constructor
 Coord2D (const T xIn, const T yIn)
 constructor for setting both components
 Coord2D (const Coord2D< T > &a)
 copy constructor
const T & operator[] (sint32 pos) const
T & operator[] (sint32 pos)
Coord2D< T > & operator= (const Coord2D< T > &a)
Coord2D< T > & operator= (const T &vIn)
Coord2D< T > & operator+= (const Coord2D< T > &b)
Coord2D< T > & operator+= (const T &b)
Coord2D< T > & operator-= (const Coord2D< T > &b)
Coord2D< T > & operator-= (const T &b)
Coord2D< T > & operator*= (const T &vIn)
Coord2D< T > & operator/= (const T &vIn)
 operator T * ()
 operator const T * () const
T * GetPtr ()
 convert the vector to a pointer to the values
const T * GetPtr () const
 convert the vector to a pointer to the values
double Length2 () const
double Length () const
void Normalize ()
 normalize vector check is done for 0 len
MaxValue () const

Private Attributes

m_data [NUM_COMPONENTS]


Detailed Description

template<class T>
class TC::Math::Coord2D< T >

Class for handling 2D values with implementation of all common operators needed.

Definition at line 65 of file TCMathCoord2D.h.


Member Typedef Documentation

template<class T >
typedef T TC::Math::Coord2D< T >::DataType

Definition at line 162 of file TCMathCoord2D.h.


Member Enumeration Documentation

template<class T >
anonymous enum

Enumerator:
NUM_COMPONENTS 

Definition at line 163 of file TCMathCoord2D.h.


Constructor & Destructor Documentation

template<class T >
TC::Math::Coord2D< T >::Coord2D ( vIn = (T)0  )  [inline]

default constructor

Parameters:
vIn value to init both vector components

Definition at line 72 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
TC::Math::Coord2D< T >::Coord2D ( const T  xIn,
const T  yIn 
) [inline]

constructor for setting both components

Parameters:
xIn value to init first vector component
yIn value to init second vector component

Definition at line 82 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
TC::Math::Coord2D< T >::Coord2D ( const Coord2D< T > &  a  )  [inline]

copy constructor

Parameters:
a value to copy

Definition at line 91 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.


Member Function Documentation

template<class T >
const T& TC::Math::Coord2D< T >::operator[] ( sint32  pos  )  const [inline]

Definition at line 100 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
T& TC::Math::Coord2D< T >::operator[] ( sint32  pos  )  [inline]

Definition at line 102 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator= ( const Coord2D< T > &  a  )  [inline]

Definition at line 107 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator= ( const T &  vIn  )  [inline]

Definition at line 108 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator+= ( const Coord2D< T > &  b  )  [inline]

Definition at line 109 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator+= ( const T &  b  )  [inline]

Definition at line 110 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator-= ( const Coord2D< T > &  b  )  [inline]

Definition at line 111 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator-= ( const T &  b  )  [inline]

Definition at line 112 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator*= ( const T &  vIn  )  [inline]

Definition at line 113 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
Coord2D<T>& TC::Math::Coord2D< T >::operator/= ( const T &  vIn  )  [inline]

Definition at line 114 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
TC::Math::Coord2D< T >::operator T * (  )  [inline]

Returns:
The template argument pointer type of this coordinate

Definition at line 118 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
TC::Math::Coord2D< T >::operator const T * (  )  const [inline]

Returns:
The const template argument pointer type of this coordinate

Definition at line 120 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
T* TC::Math::Coord2D< T >::GetPtr (  )  [inline]

convert the vector to a pointer to the values

Returns:
the pointer to the values

Definition at line 126 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
const T* TC::Math::Coord2D< T >::GetPtr (  )  const [inline]

convert the vector to a pointer to the values

Returns:
the const pointer to the values

Definition at line 131 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

template<class T >
double TC::Math::Coord2D< T >::Length2 (  )  const [inline]

Returns:
the square length of the vector

Definition at line 135 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data.

Referenced by TC::Math::Coord2D< T >::Length(), and TC::Math::Coord2D< T >::Normalize().

Here is the caller graph for this function:

template<class T >
double TC::Math::Coord2D< T >::Length (  )  const [inline]

Returns:
the length of the vector

Definition at line 139 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::Length2().

Here is the call graph for this function:

template<class T >
void TC::Math::Coord2D< T >::Normalize (  )  [inline]

normalize vector check is done for 0 len

Definition at line 144 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::Length2(), and TC::Math::Coord2D< T >::m_data.

Here is the call graph for this function:

template<class T >
T TC::Math::Coord2D< T >::MaxValue (  )  const [inline]

Returns:
the maximum of all 3 components

Definition at line 157 of file TCMathCoord2D.h.

References TC::Math::Coord2D< T >::m_data, and TC::Math::Max().

Here is the call graph for this function:


Member Data Documentation

template<class T >
T TC::Math::Coord2D< T >::m_data[NUM_COMPONENTS] [private]


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

Copyright (c) Thomas Goessler 2003 - 2008