OpenStructure
Public Member Functions | Data Fields
Vec4 Class Reference

#include <vec4.hh>

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

Public Member Functions

 Vec4 ()
 
 Vec4 (Real px, Real py, Real pz, Real pw)
 
 Vec4 (const Vec4 &v)
 
 Vec4 (const Vec2 &v)
 
 Vec4 (const Vec3 &v)
 
 Vec4 (const float v[4])
 
 Vec4 (const double v[4])
 
Vec4operator= (const Vec4 &v)
 
bool operator== (const Vec4 &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
 
Real GetW () const
 
void SetX (Real v)
 
void SetY (Real v)
 
void SetZ (Real v)
 
void SetW (Real v)
 
Vec4operator+= (const Vec4 &rhs)
 
Vec4operator+= (Real d)
 
Vec4operator-= (const Vec4 &rhs)
 
Vec4operator-= (Real d)
 
Vec4 operator- () const
 
Vec4operator*= (Real d)
 
Vec4operator/= (Real d)
 
RealData ()
 
const RealData () const
 

Data Fields

Real x
 
Real y
 
Real z
 
Real w
 

Detailed Description

Definition at line 41 of file vec4.hh.

Constructor & Destructor Documentation

◆ Vec4() [1/7]

Vec4 ( )
inline

Default initialization, all components are set to zero.

Definition at line 49 of file vec4.hh.

◆ Vec4() [2/7]

Vec4 ( Real  px,
Real  py,
Real  pz,
Real  pw 
)
inline

Initialization with x, y and z component.

Definition at line 52 of file vec4.hh.

◆ Vec4() [3/7]

Vec4 ( const Vec4 v)
inline

copy ctor

Definition at line 55 of file vec4.hh.

◆ Vec4() [4/7]

Vec4 ( const Vec2 v)
inline

(implicit) initialization with 2D vector

Definition at line 215 of file vec4.hh.

◆ Vec4() [5/7]

Vec4 ( const Vec3 v)
inline

(implicit) initialization with 3D vector

Definition at line 218 of file vec4.hh.

◆ Vec4() [6/7]

Vec4 ( const float  v[4])
inlineexplicit

explicit initialization with an array of floats

Definition at line 64 of file vec4.hh.

◆ Vec4() [7/7]

Vec4 ( const double  v[4])
inlineexplicit

explicit initialization with an array of doubles

Definition at line 67 of file vec4.hh.

Member Function Documentation

◆ At() [1/2]

Real& At ( size_t  indx)
inline

Definition at line 98 of file vec4.hh.

◆ At() [2/2]

const Real& At ( size_t  indx) const
inline

Definition at line 105 of file vec4.hh.

◆ Data() [1/2]

Real* Data ( )
inline

Definition at line 187 of file vec4.hh.

◆ Data() [2/2]

const Real* Data ( ) const
inline

Definition at line 188 of file vec4.hh.

◆ GetW()

Real GetW ( ) const
inline

Definition at line 116 of file vec4.hh.

◆ GetX()

Real GetX ( ) const
inline

element access

Definition at line 113 of file vec4.hh.

◆ GetY()

Real GetY ( ) const
inline

Definition at line 114 of file vec4.hh.

◆ GetZ()

Real GetZ ( ) const
inline

Definition at line 115 of file vec4.hh.

◆ operator*=()

Vec4& operator*= ( Real  d)
inline

multipliable

Definition at line 167 of file vec4.hh.

◆ operator+=() [1/2]

Vec4& operator+= ( const Vec4 rhs)
inline

addable op

Definition at line 124 of file vec4.hh.

◆ operator+=() [2/2]

Vec4& operator+= ( Real  d)
inline

Definition at line 133 of file vec4.hh.

◆ operator-()

Vec4 operator- ( ) const
inline

negateable

Definition at line 161 of file vec4.hh.

◆ operator-=() [1/2]

Vec4& operator-= ( const Vec4 rhs)
inline

subtractable op

Definition at line 143 of file vec4.hh.

◆ operator-=() [2/2]

Vec4& operator-= ( Real  d)
inline

Definition at line 152 of file vec4.hh.

◆ operator/=()

Vec4& operator/= ( Real  d)
inline

dividable

Definition at line 177 of file vec4.hh.

◆ operator=()

Vec4& operator= ( const Vec4 v)
inline

assignement op

Definition at line 69 of file vec4.hh.

◆ operator==()

bool operator== ( const Vec4 rhs) const
inline

comparable

Definition at line 79 of file vec4.hh.

◆ operator[]() [1/2]

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

element access

Definition at line 85 of file vec4.hh.

◆ operator[]() [2/2]

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

const element access

Definition at line 92 of file vec4.hh.

◆ SetW()

void SetW ( Real  v)
inline

Definition at line 121 of file vec4.hh.

◆ SetX()

void SetX ( Real  v)
inline

Definition at line 118 of file vec4.hh.

◆ SetY()

void SetY ( Real  v)
inline

Definition at line 119 of file vec4.hh.

◆ SetZ()

void SetZ ( Real  v)
inline

Definition at line 120 of file vec4.hh.

Field Documentation

◆ w

Real w

Definition at line 193 of file vec4.hh.

◆ x

Real x

Definition at line 190 of file vec4.hh.

◆ y

Real y

Definition at line 191 of file vec4.hh.

◆ z

Real z

Definition at line 192 of file vec4.hh.


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