Vec3< T > Class Template Reference

small class which defines a vector with 3 elements More...

#include <libmwaw_internal.hxx>

List of all members.

Classes

struct  PosSizeLt
 internal struct used to create sorted map, sorted by X, Y, Z More...

Public Types

typedef std::map< Vec3< T >, T,
struct PosSizeLt
Map
 map of Vec3

Public Member Functions

 Vec3 (T xx=0, T yy=0, T zz=0)
 constructor
template<class U >
 Vec3 (Vec3< U > const &p)
 generic copy constructor
x () const
 first element
y () const
 second element
z () const
 third element
operator[] (int c) const
 operator[]
T & operator[] (int c)
 operator[]
void set (T xx, T yy, T zz)
 resets the three elements
void setX (T xx)
 resets the first element
void setY (T yy)
 resets the second element
void setZ (T zz)
 resets the third element
void add (T dx, T dy, T dz)
 increases the actuals values by dx, dy, dz
Vec3< T > & operator+= (Vec3< T > const &p)
 operator+=
Vec3< T > & operator-= (Vec3< T > const &p)
 operator-=
template<class U >
Vec3< T > & operator*= (U scale)
 generic operator*=
bool operator== (Vec3< T > const &p) const
 comparison==
bool operator!= (Vec3< T > const &p) const
 comparison!=
bool operator< (Vec3< T > const &p) const
 comparison<: which first compares x values, then y values then z values.
int cmp (Vec3< T > const &p) const
 a comparison function: which first compares x values, then y values then z values.

Protected Attributes

m_val [3]
 the values

Friends

Vec3< T > operator+ (Vec3< T > const &p1, Vec3< T > const &p2)
 operator+
Vec3< T > operator- (Vec3< T > const &p1, Vec3< T > const &p2)
 operator-
template<class U >
Vec3< T > operator* (U scale, Vec3< T > const &p1)
 generic operator*
std::ostream & operator<< (std::ostream &o, Vec3< T > const &f)
 operator<<: prints data in form "XxYxZ"

Detailed Description

template<class T>
class Vec3< T >

small class which defines a vector with 3 elements


Member Typedef Documentation

template<class T>
Vec3< T >::Map

map of Vec3


Constructor & Destructor Documentation

template<class T>
Vec3< T >::Vec3 ( xx = 0,
yy = 0,
zz = 0 
) [inline]

constructor

template<class T>
template<class U >
Vec3< T >::Vec3 ( Vec3< U > const &  p) [inline]

generic copy constructor


Member Function Documentation

template<class T>
void Vec3< T >::add ( dx,
dy,
dz 
) [inline]

increases the actuals values by dx, dy, dz

template<class T>
int Vec3< T >::cmp ( Vec3< T > const &  p) const [inline]

a comparison function: which first compares x values, then y values then z values.

Referenced by Vec3< T >::operator!=(), Vec3< T >::PosSizeLt::operator()(), Vec3< T >::operator<(), and Vec3< T >::operator==().

template<class T>
bool Vec3< T >::operator!= ( Vec3< T > const &  p) const [inline]

comparison!=

template<class T>
template<class U >
Vec3<T>& Vec3< T >::operator*= ( scale) [inline]

generic operator*=

template<class T>
Vec3<T>& Vec3< T >::operator+= ( Vec3< T > const &  p) [inline]

operator+=

template<class T>
Vec3<T>& Vec3< T >::operator-= ( Vec3< T > const &  p) [inline]

operator-=

template<class T>
bool Vec3< T >::operator< ( Vec3< T > const &  p) const [inline]

comparison<: which first compares x values, then y values then z values.

template<class T>
bool Vec3< T >::operator== ( Vec3< T > const &  p) const [inline]

comparison==

template<class T>
T Vec3< T >::operator[] ( int  c) const [inline]

operator[]

template<class T>
T& Vec3< T >::operator[] ( int  c) [inline]

operator[]

template<class T>
void Vec3< T >::set ( xx,
yy,
zz 
) [inline]

resets the three elements

template<class T>
void Vec3< T >::setX ( xx) [inline]

resets the first element

template<class T>
void Vec3< T >::setY ( yy) [inline]

resets the second element

template<class T>
void Vec3< T >::setZ ( zz) [inline]

resets the third element

template<class T>
T Vec3< T >::x ( ) const [inline]

first element

template<class T>
T Vec3< T >::y ( ) const [inline]

second element

template<class T>
T Vec3< T >::z ( ) const [inline]

third element


Friends And Related Function Documentation

template<class T>
template<class U >
Vec3<T> operator* ( scale,
Vec3< T > const &  p1 
) [friend]

generic operator*

template<class T>
Vec3<T> operator+ ( Vec3< T > const &  p1,
Vec3< T > const &  p2 
) [friend]

operator+

template<class T>
Vec3<T> operator- ( Vec3< T > const &  p1,
Vec3< T > const &  p2 
) [friend]

operator-

template<class T>
std::ostream& operator<< ( std::ostream &  o,
Vec3< T > const &  f 
) [friend]

operator<<: prints data in form "XxYxZ"


Member Data Documentation


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