OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Data Fields
Vec3 Class Reference

#include <vec3.hh>

Inherits equality_comparable< Vec3 >, additive< Vec3 >, additive< Vec3, Real >, and multiplicative< Vec3, Real >.

Public Member Functions

 Vec3 ()
 
 Vec3 (Real px, Real py, Real pz)
 
 Vec3 (const Vec3 &v)
 
 Vec3 (const Vec2 &v)
 
 Vec3 (const Vec4 &v)
 
 Vec3 (Real v)
 
 Vec3 (const double v[3])
 
 Vec3 (const float v[3])
 
Vec3operator= (const Vec3 &v)
 
bool operator== (const Vec3 &rhs) const
 
Realoperator[] (std::size_t indx)
 
const Realoperator[] (std::size_t indx) const
 
RealAt (size_t indx)
 
const RealAt (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
 

Data Fields

Real x
 
Real y
 
Real z
 

Detailed Description

Three dimensional vector class, using Real precision.

Definition at line 43 of file vec3.hh.

Constructor & Destructor Documentation

Vec3 ( )
inline

Default initialization, all components are set to zero.

Definition at line 51 of file vec3.hh.

Vec3 ( Real  px,
Real  py,
Real  pz 
)
inline

Initialization with x, y and z component.

Definition at line 54 of file vec3.hh.

Vec3 ( const Vec3 v)
inline

copy ctor

Definition at line 57 of file vec3.hh.

Vec3 ( const Vec2 v)
inline

(implicit) initialization with 2D vector

Definition at line 367 of file vec3.hh.

Vec3 ( const Vec4 v)
inlineexplicit

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)

Definition at line 369 of file vec3.hh.

Vec3 ( Real  v)
inlineexplicit

Definition at line 69 of file vec3.hh.

Vec3 ( const double  v[3])
inlineexplicit

explicit initialization with an array of doubles

Definition at line 72 of file vec3.hh.

Vec3 ( const float  v[3])
inlineexplicit

explicit initialization with an array of floats

Definition at line 75 of file vec3.hh.

Member Function Documentation

Real& At ( size_t  indx)
inline

Definition at line 124 of file vec3.hh.

const Real& At ( size_t  indx) const
inline

Definition at line 131 of file vec3.hh.

Real* Data ( )
inline

Definition at line 203 of file vec3.hh.

const Real* Data ( ) const
inline

Definition at line 204 of file vec3.hh.

Real GetX ( ) const
inline

element access

Definition at line 138 of file vec3.hh.

Real GetY ( ) const
inline

Definition at line 139 of file vec3.hh.

Real GetZ ( ) const
inline

Definition at line 140 of file vec3.hh.

Vec3& operator*= ( Real  d)
inline

multipliable

Definition at line 185 of file vec3.hh.

Vec3& operator+= ( const Vec3 rhs)
inline

addable op

Definition at line 146 of file vec3.hh.

Vec3& operator+= ( Real  d)
inline

Definition at line 154 of file vec3.hh.

Vec3 operator- ( ) const
inline

negateable

Definition at line 179 of file vec3.hh.

Vec3& operator-= ( const Vec3 rhs)
inline

subtractable op

Definition at line 163 of file vec3.hh.

Vec3& operator-= ( Real  d)
inline

Definition at line 171 of file vec3.hh.

Vec3& operator/= ( Real  d)
inline

dividable

Definition at line 194 of file vec3.hh.

Vec3& operator= ( const Vec3 v)
inline

assignement op

Definition at line 95 of file vec3.hh.

bool operator== ( const Vec3 rhs) const
inline

comparable

Definition at line 105 of file vec3.hh.

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

element access

Definition at line 111 of file vec3.hh.

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

const element access

Definition at line 118 of file vec3.hh.

void SetX ( Real  v)
inline

Definition at line 141 of file vec3.hh.

void SetY ( Real  v)
inline

Definition at line 142 of file vec3.hh.

void SetZ ( Real  v)
inline

Definition at line 143 of file vec3.hh.

Field Documentation

Real x

Definition at line 206 of file vec3.hh.

Real y

Definition at line 207 of file vec3.hh.

Real z

Definition at line 208 of file vec3.hh.


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