mathglpp::GLVectorArray3< T > Class Template Reference

#include <GLVector.h>

Collaboration diagram for mathglpp::GLVectorArray3< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T>
class mathglpp::GLVectorArray3< T >

a 3D vector array class for OpenGL

Definition at line 742 of file GLVector.h.

Public Types

enum  { D = 3 }
typedef T value_type
typedef std::valarray< value_typevector_type

Public Member Functions

 GLVectorArray3 ()
 Create an uninitialised vector.
 GLVectorArray3 (const T &v)
 Create an initialised vector.
 GLVectorArray3 (const GLVectorArray3 &gv)
 Copy a vector.
 GLVectorArray3 (const vector_type &v)
 Copy a vector.
 GLVectorArray3 (const T *f, int nVec)
 Create a vector from an array.
 ~GLVectorArray3 ()
 Default destructor.
T & operator[] (int ind)
 element by element accessor
 operator T * (void)
 implicit casting to a pointer
 operator const T * (void) const
 implicit casting to a const pointer
void copyTo (T *v) const
 copy values to a array
const GLVectorArray3 operator+ (const GLVectorArray3 &gv) const
 Get the sum of this and a vector.
const GLVectorArray3 operator- (const GLVectorArray3 &gv) const
 Get the difference of this and a vector.
const GLVectorArray3 operator * (const GLVectorArray3 &gv) const
 Get the element-by-element product of this and a vector.
const GLVectorArray3 operator/ (const GLVectorArray3 &gv) const
 Get the element-by-element quota of this and a vector.
const GLVectorArray3 operator * (const T &v) const
 Get the element-by-element product of this and a scalar.
const GLVectorArray3 operator/ (const T &v) const
 Get the element-by-element quota of this and a scalar.
GLVectorArray3operator+= (const GLVectorArray3 &gv)
 Add a vector to this.
GLVectorArray3operator-= (const GLVectorArray3 &gv)
 Subtract a vector from this.
GLVectorArray3operator *= (const T &f)
 Multiply this by a scalar.
GLVectorArray3operator/= (const T &f)
 Divide this by a scalar.
GLVectorArray3operator= (const GLVectorArray3 &gv)
 copy this from a vector
const GLVectorArray3 operator- () const
 negate this

Public Attributes

vector_type vec
 Value array.


Member Enumeration Documentation

template<typename T>
anonymous enum

Enumerator:
D 

Definition at line 745 of file GLVector.h.

00745 { D = 3 };


Constructor & Destructor Documentation

template<typename T>
mathglpp::GLVectorArray3< T >::GLVectorArray3 (  )  [inline]

Create an uninitialised vector.

Definition at line 750 of file GLVector.h.

Referenced by mathglpp::GLVectorArray3< T >::operator *(), mathglpp::GLVectorArray3< T >::operator+(), mathglpp::GLVectorArray3< T >::operator-(), and mathglpp::GLVectorArray3< T >::operator/().

00750 :vec() { }

template<typename T>
mathglpp::GLVectorArray3< T >::GLVectorArray3 ( const T &  v  )  [inline]

Create an initialised vector.

Definition at line 753 of file GLVector.h.

00754     :vec(v) { }

template<typename T>
mathglpp::GLVectorArray3< T >::GLVectorArray3 ( const GLVectorArray3< T > &  gv  )  [inline]

Copy a vector.

Definition at line 757 of file GLVector.h.

00758     :vec(gv.vec)
00759     { }

template<typename T>
mathglpp::GLVectorArray3< T >::GLVectorArray3 ( const vector_type v  )  [inline]

Copy a vector.

Definition at line 762 of file GLVector.h.

00763     :vec(v)
00764     { }

template<typename T>
mathglpp::GLVectorArray3< T >::GLVectorArray3 ( const T *  f,
int  nVec 
) [inline]

Create a vector from an array.

Definition at line 767 of file GLVector.h.

00768     :vec(f,nVec*D)
00769     { }

template<typename T>
mathglpp::GLVectorArray3< T >::~GLVectorArray3 (  )  [inline]

Default destructor.

Definition at line 772 of file GLVector.h.

00772 {}


Member Function Documentation

template<typename T>
T& mathglpp::GLVectorArray3< T >::operator[] ( int  ind  )  [inline]

element by element accessor

Definition at line 775 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00776     {   return vec[ind]; }

template<typename T>
mathglpp::GLVectorArray3< T >::operator T * ( void   )  [inline]

implicit casting to a pointer

Definition at line 779 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00780     {   return &vec[0]; }

template<typename T>
mathglpp::GLVectorArray3< T >::operator const T * ( void   )  const [inline]

implicit casting to a const pointer

Definition at line 783 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00784     {   return &vec[0]; }

template<typename T>
void mathglpp::GLVectorArray3< T >::copyTo ( T *  v  )  const [inline]

copy values to a array

Definition at line 787 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::D, and mathglpp::GLVectorArray3< T >::vec.

00788     {   memmove(v,&vec[0],D*sizeof(T)); }

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator+ ( const GLVectorArray3< T > &  gv  )  const [inline]

Get the sum of this and a vector.

Definition at line 791 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00792     {
00793         return GLVectorArray3(*this)+=gv;
00794     }

Here is the call graph for this function:

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator- ( const GLVectorArray3< T > &  gv  )  const [inline]

Get the difference of this and a vector.

Definition at line 797 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00798     {
00799         return GLVectorArray3(*this)-=gv;
00800     }

Here is the call graph for this function:

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator * ( const GLVectorArray3< T > &  gv  )  const [inline]

Get the element-by-element product of this and a vector.

Definition at line 803 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00804     {
00805         return GLVectorArray3(*this)*=gv;
00806     }

Here is the call graph for this function:

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator/ ( const GLVectorArray3< T > &  gv  )  const [inline]

Get the element-by-element quota of this and a vector.

Definition at line 809 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00810     {
00811         return GLVectorArray3(*this)/=gv;
00812     }

Here is the call graph for this function:

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator * ( const T &  v  )  const [inline]

Get the element-by-element product of this and a scalar.

Definition at line 815 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00816     {
00817         return GLVectorArray3(*this)*=v;
00818     }

Here is the call graph for this function:

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator/ ( const T &  v  )  const [inline]

Get the element-by-element quota of this and a scalar.

Definition at line 821 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3().

00822     {
00823         return GLVectorArray3(*this)/=v;
00824     }

Here is the call graph for this function:

template<typename T>
GLVectorArray3& mathglpp::GLVectorArray3< T >::operator+= ( const GLVectorArray3< T > &  gv  )  [inline]

Add a vector to this.

Definition at line 827 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00828     {
00829         vec += gv.vec;
00830         return *this;
00831     }

template<typename T>
GLVectorArray3& mathglpp::GLVectorArray3< T >::operator-= ( const GLVectorArray3< T > &  gv  )  [inline]

Subtract a vector from this.

Definition at line 834 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00835     {
00836         vec -= gv.vec;
00837         return *this;
00838     }

template<typename T>
GLVectorArray3& mathglpp::GLVectorArray3< T >::operator *= ( const T &  f  )  [inline]

Multiply this by a scalar.

Definition at line 841 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00842     {
00843         vec *= f;
00844         return *this;
00845     }

template<typename T>
GLVectorArray3& mathglpp::GLVectorArray3< T >::operator/= ( const T &  f  )  [inline]

Divide this by a scalar.

Definition at line 848 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00849     {
00850         vec /= f;
00851         return *this;
00852     }

template<typename T>
GLVectorArray3& mathglpp::GLVectorArray3< T >::operator= ( const GLVectorArray3< T > &  gv  )  [inline]

copy this from a vector

Definition at line 855 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::vec.

00856     {
00857         vec = gv.vec;
00858         return *this;
00859     }

template<typename T>
const GLVectorArray3 mathglpp::GLVectorArray3< T >::operator- (  )  const [inline]

negate this

Definition at line 862 of file GLVector.h.

References mathglpp::GLVectorArray3< T >::GLVectorArray3(), and mathglpp::GLVectorArray3< T >::vec.

00863     {
00864         return GLVectorArray3(-vec);
00865     }

Here is the call graph for this function:


Member Data Documentation

template<typename T>
vector_type mathglpp::GLVectorArray3< T >::vec

Value array.

Definition at line 868 of file GLVector.h.

Referenced by mathglpp::GLVectorArray3< T >::copyTo(), mathglpp::GLVectorArray3< T >::operator *=(), mathglpp::GLVectorArray3< T >::operator const T *(), mathglpp::GLVectorArray3< T >::operator T *(), mathglpp::GLVectorArray3< T >::operator+=(), mathglpp::GLVectorArray3< T >::operator-(), mathglpp::GLVectorArray3< T >::operator-=(), mathglpp::GLVectorArray3< T >::operator/=(), mathglpp::GLVectorArray3< T >::operator=(), and mathglpp::GLVectorArray3< T >::operator[]().


The documentation for this class was generated from the following file:
Generated on Wed Oct 3 12:50:53 2007 for MathGL++ by  doxygen 1.5.2