WPSVec3< T > Class Template Reference

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

#include <libwps_internal.h>

Classes

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

Public Types

typedef std::map< WPSVec3< T >, T, struct PosSizeLtMap
 map of WPSVec3

Public Member Functions

 WPSVec3 (T xx=0, T yy=0, T zz=0)
 constructor
template<class U>
 WPSVec3 (WPSVec3< 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
WPSVec3< T > & operator+= (WPSVec3< T > const &p)
 operator+=
WPSVec3< T > & operator-= (WPSVec3< T > const &p)
 operator-=
template<class U>
WPSVec3< T > & operator*= (U scale)
 generic operator*=
bool operator== (WPSVec3< T > const &p) const
 comparison==
bool operator!= (WPSVec3< T > const &p) const
 comparison!=
bool operator< (WPSVec3< T > const &p) const
 comparison<: which first compares x values, then y values then z values.
int cmp (WPSVec3< 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

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

Detailed Description

template<class T>
class WPSVec3< T >

small class which defines a vector with 3 elements

Member Typedef Documentation

◆ Map

template<class T>
typedef std::map<WPSVec3<T>, T,struct PosSizeLt> WPSVec3< T >::Map

map of WPSVec3

Constructor & Destructor Documentation

◆ WPSVec3() [1/2]

template<class T>
WPSVec3< T >::WPSVec3 ( T xx = 0,
T yy = 0,
T zz = 0 )
inlineexplicit

constructor

Referenced by WPSVec3< T >::PosSizeLt::operator()().

◆ WPSVec3() [2/2]

template<class T>
template<class U>
WPSVec3< T >::WPSVec3 ( WPSVec3< U > const & p)
inlineexplicit

generic copy constructor

Member Function Documentation

◆ add()

template<class T>
void WPSVec3< T >::add ( T dx,
T dy,
T dz )
inline

increases the actuals values by dx, dy, dz

◆ cmp()

template<class T>
int WPSVec3< T >::cmp ( WPSVec3< T > const & p) const
inline

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

Referenced by WPSVec3< unsigned char >::operator!=(), WPSVec3< T >::PosSizeLt::operator()(), WPSVec3< unsigned char >::operator<(), and WPSVec3< unsigned char >::operator==().

◆ operator!=()

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

comparison!=

◆ operator*=()

template<class T>
template<class U>
WPSVec3< T > & WPSVec3< T >::operator*= ( U scale)
inline

generic operator*=

◆ operator+=()

template<class T>
WPSVec3< T > & WPSVec3< T >::operator+= ( WPSVec3< T > const & p)
inline

operator+=

◆ operator-=()

template<class T>
WPSVec3< T > & WPSVec3< T >::operator-= ( WPSVec3< T > const & p)
inline

operator-=

◆ operator<()

template<class T>
bool WPSVec3< T >::operator< ( WPSVec3< T > const & p) const
inline

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

◆ operator==()

template<class T>
bool WPSVec3< T >::operator== ( WPSVec3< T > const & p) const
inline

comparison==

◆ operator[]() [1/2]

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

operator[]

◆ operator[]() [2/2]

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

operator[]

◆ set()

template<class T>
void WPSVec3< T >::set ( T xx,
T yy,
T zz )
inline

resets the three elements

◆ setX()

template<class T>
void WPSVec3< T >::setX ( T xx)
inline

resets the first element

◆ setY()

template<class T>
void WPSVec3< T >::setY ( T yy)
inline

resets the second element

◆ setZ()

template<class T>
void WPSVec3< T >::setZ ( T zz)
inline

resets the third element

◆ x()

template<class T>
T WPSVec3< T >::x ( ) const
inline

first element

◆ y()

template<class T>
T WPSVec3< T >::y ( ) const
inline

second element

◆ z()

template<class T>
T WPSVec3< T >::z ( ) const
inline

third element

◆ operator*

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

generic operator*

◆ operator+

template<class T>
WPSVec3< T > operator+ ( WPSVec3< T > const & p1,
WPSVec3< T > const & p2 )
friend

operator+

◆ operator-

template<class T>
WPSVec3< T > operator- ( WPSVec3< T > const & p1,
WPSVec3< T > const & p2 )
friend

operator-

◆ operator<<

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

operator<<: prints data in form "XxYxZ"

Member Data Documentation

◆ m_val


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

Generated on Sat Jul 19 2025 05:24:41 for libwps by doxygen 1.14.0