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

Class for handling 3D values With implementation of all common coordinate or vector operators needed. More...

#include <TCMathCoord3D.h>

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

Collaboration graph
[legend]

List of all members.

Public Types

enum  { NUM_COMPONENTS = 3 }
typedef T DataType

Public Member Functions

 Coord3D ()
 all thre components are init with 0
 Coord3D (const T vIn)
 Init all components with one value.
 Coord3D (const T vIn[])
 Init components with values of an array.
 Coord3D (const T xIn, const T yIn, const T zIn)
 Constructor for setting all three components with different values.
 Coord3D (const Coord3D< T > &coord)
 Copy constructor.
const T & operator[] (sint32 pos) const
 Get one of the 3 component values.
T & operator[] (sint32 pos)
 Set one of the 3 component values.
Coord3D< T > & operator= (const Coord3D< T > &a)
Coord3D< T > & operator= (const T &vIn)
Coord3D< T > & operator+= (const Coord3D< T > &b)
Coord3D< T > & operator+= (const T &b)
Coord3D< T > & operator-= (const Coord3D< T > &b)
Coord3D< T > & operator-= (const T &b)
Coord3D< T > & operator*= (const T &vIn)
Coord3D< T > & operator/= (const T &vIn)
 operator T * ()
 operator const T * () const
double Length2 () const
double Length () const
void Normalize ()
 Normalize vector Check for 0 len is done.
MaxValue () const

Private Attributes

m_data [NUM_COMPONENTS]
 stores the three components of the coordinate


Detailed Description

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

Class for handling 3D values With implementation of all common coordinate or vector operators needed.

Definition at line 65 of file TCMathCoord3D.h.


Member Typedef Documentation

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

Definition at line 175 of file TCMathCoord3D.h.


Member Enumeration Documentation

template<class T >
anonymous enum

Enumerator:
NUM_COMPONENTS 

Definition at line 176 of file TCMathCoord3D.h.


Constructor & Destructor Documentation

template<class T >
TC::Math::Coord3D< T >::Coord3D (  )  [inline]

all thre components are init with 0

Definition at line 69 of file TCMathCoord3D.h.

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

template<class T >
TC::Math::Coord3D< T >::Coord3D ( const T  vIn  )  [inline, explicit]

Init all components with one value.

Definition at line 79 of file TCMathCoord3D.h.

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

template<class T >
TC::Math::Coord3D< T >::Coord3D ( const T  vIn[]  )  [inline, explicit]

Init components with values of an array.

Definition at line 89 of file TCMathCoord3D.h.

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

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

Constructor for setting all three components with different values.

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

Definition at line 104 of file TCMathCoord3D.h.

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

template<class T >
TC::Math::Coord3D< T >::Coord3D ( const Coord3D< T > &  coord  )  [inline]

Copy constructor.

Parameters:
coord value to copy

Definition at line 116 of file TCMathCoord3D.h.

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


Member Function Documentation

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

Get one of the 3 component values.

Definition at line 125 of file TCMathCoord3D.h.

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

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

Set one of the 3 component values.

Definition at line 127 of file TCMathCoord3D.h.

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

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

Definition at line 131 of file TCMathCoord3D.h.

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

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

Definition at line 132 of file TCMathCoord3D.h.

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

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

Definition at line 133 of file TCMathCoord3D.h.

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

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

Definition at line 134 of file TCMathCoord3D.h.

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

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

Definition at line 135 of file TCMathCoord3D.h.

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

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

Definition at line 136 of file TCMathCoord3D.h.

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

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

Definition at line 137 of file TCMathCoord3D.h.

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

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

Definition at line 138 of file TCMathCoord3D.h.

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

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

Returns:
The template argument pointer type of this coordinate

Definition at line 143 of file TCMathCoord3D.h.

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

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

Returns:
The const template argument pointer type of this coordinate

Definition at line 145 of file TCMathCoord3D.h.

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

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

Returns:
The square length of the vector

Definition at line 148 of file TCMathCoord3D.h.

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

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

Here is the caller graph for this function:

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

Returns:
The length of the vector

Definition at line 150 of file TCMathCoord3D.h.

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

Here is the call graph for this function:

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

Normalize vector Check for 0 len is done.

Definition at line 155 of file TCMathCoord3D.h.

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

Here is the call graph for this function:

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

Returns:
the maximum of all 3 components

Definition at line 170 of file TCMathCoord3D.h.

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

Here is the call graph for this function:


Member Data Documentation

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


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

Copyright (c) Thomas Goessler 2003 - 2008