Vec3 Class Reference

Three dimensional vector class, using Real precision. More...

#include <vec3.hh>


Public Member Functions

 Vec3 ()
 Vec3 (Real x, Real y, Real z)
 Vec3 (const Vec3 &v)
 Vec3 (const Vec2 &v)
 Vec3 (const Vec4 &v)
 Vec3 (const Real[3])
Vec3operator= (const Vec3 &v)
bool operator== (const Vec3 &rhs) const
Realoperator[] (std::size_t indx)
const Realoperator[] (std::size_t indx) const
Real GetX () const
Real GetY () const
Real GetZ () const
void SetX (Real v)
void SetY (Real v)
void SetZ (Real v)
Vec3operator+= (const Vec3 &rhs)
Vec3operator+= (Real d)
Vec3operator-= (const Vec3 &rhs)
Vec3operator-= (Real d)
Vec3 operator- () const
Vec3operator*= (Real d)
Vec3operator/= (Real d)
RealData ()
const RealData () const


Detailed Description

Three dimensional vector class, using Real precision.

Definition at line 38 of file vec3.hh.


Constructor & Destructor Documentation

Vec3 (  ) 

Default initialization, all components are set to zero.

Vec3 ( Real  x,
Real  y,
Real  z 
)

Initialization with x, y and z component.

Vec3 ( const Vec3 v  ) 

copy ctor

Vec3 ( const Vec2 v  ) 

(implicit) initialization with 2D vector

Vec3 ( const Vec4 v  )  [explicit]

explicit initialization with a 4D homogeneous vector

a 4D (homogeneous) vector can be explicitely converted to a 3D vector, resulting in (x/w,y/w,z/w)

Vec3 ( const   Real[3]  )  [explicit]

explicit initialization with an array of doubles


Member Function Documentation

const Real* Data (  )  const [inline]

Definition at line 103 of file vec3.hh.

Real* Data (  )  [inline]

Definition at line 102 of file vec3.hh.

Real GetX (  )  const

element access

Real GetY (  )  const

Real GetZ (  )  const

Vec3& operator*= ( Real  d  ) 

multipliable

Vec3& operator+= ( Real  d  ) 

Vec3& operator+= ( const Vec3 rhs  ) 

addable op

Vec3 operator- (  )  const

negateable

Vec3& operator-= ( Real  d  ) 

Vec3& operator-= ( const Vec3 rhs  ) 

subtractable op

Vec3& operator/= ( Real  d  ) 

dividable

Vec3& operator= ( const Vec3 v  ) 

assignement op

bool operator== ( const Vec3 rhs  )  const

comparable

const Real& operator[] ( std::size_t  indx  )  const

const element access

Real& operator[] ( std::size_t  indx  ) 

element access

void SetX ( Real  v  ) 

void SetY ( Real  v  ) 

void SetZ ( Real  v  ) 


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

Generated on Fri Jul 2 14:23:06 2010 for OpenStructure by  doxygen 1.5.8