open_iA  2020.04
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Member Functions | List of all members
iAVec3T< T > Class Template Reference

Class representing a 3-dimensional vector. More...

#include <iAvec3.h>

Collaboration diagram for iAVec3T< T >:

Public Member Functions

T * data ()
 access to the raw array of size 3 holding the components More...
 
T const * data () const
 access to the raw array of size 3 holding the components (const version) More...
 
 iAVec3T ()
 initialize empty vector (all components =0) More...
 
template<typename ParamType >
 iAVec3T (const iAVec3T< ParamType > &v)
 initialize vector components from another vector More...
 
 iAVec3T (T data[3])
 initialize vector components from an array More...
 
 iAVec3T (T px, T py, T pz)
 initialize vector from three values (of potentially different type) More...
 
 iAVec3T (T val)
 initialize all vector components to the same value More...
 
length () const
 get the length of the vector, alias for magnitude() More...
 
magnitude () const
 get the length of the vector More...
 
void normalize ()
 make this vector normalized, i.e. set the length to 1 but keep direction More...
 
iAVec3T< T > normalized () const
 get a normalize vector, i.e., a vector of length=1 pointing in the same direction More...
 
template<typename ParamType >
iAVec3T< T > & operator*= (const iAVec3T< ParamType > &v)
 multiply another vector with this More...
 
template<typename ParamType >
iAVec3T< T > & operator*= (ParamType f)
 multiply a constant to every component of this More...
 
iAVec3T< T > operator+ () const
 unary + operator. Note: this is not handling the addition of two vectors! It just allows to write " +someVectorVariable" as an expression, it returns the vector itself More...
 
template<typename ParamType >
iAVec3T< T > & operator+= (const iAVec3T< ParamType > &v)
 add another vector to this More...
 
iAVec3T< T > operator- () const
 unary - operator. Writing "-someVectorVariable" returns a vector with all components of someVectorVariable multiplied by -1 More...
 
template<typename ParamType >
iAVec3T< T > & operator-= (const iAVec3T< ParamType > &v)
 subtract another vector from this More...
 
template<typename ParamType >
iAVec3T< T > & operator/= (const iAVec3T< ParamType > &v)
 divide all components of this vector by the respective components of another vector More...
 
template<typename ParamType >
iAVec3T< T > & operator= (const iAVec3T< ParamType > &v)
 assign another vector More...
 
template<typename ParamType >
iAVec3T< T > & operator= (ParamType d)
 assign a single value to all components More...
 
T & operator[] (size_t index)
 indexed read&write access to the components of this vector; index=0 -> x, index=1 -> y index=2 -> z More...
 
const T & operator[] (size_t index) const
 constant indexed access to the components of this vector; index=0 -> x, index=1 -> y index=2 -> z More...
 
sqrMagnitude () const
 get the squared length of the vector More...
 
sum () const
 get the sum of all vector components More...
 
x () const
 access the x component of the vector More...
 
y () const
 access the y component of the vector More...
 
z () const
 access the z component of the vector More...
 

Detailed Description

template<typename T>
class iAVec3T< T >

Class representing a 3-dimensional vector.

Constructor & Destructor Documentation

◆ iAVec3T() [1/5]

template<typename T >
iAVec3T< T >::iAVec3T

initialize empty vector (all components =0)

◆ iAVec3T() [2/5]

template<typename T >
iAVec3T< T >::iAVec3T ( val)
explicit

initialize all vector components to the same value

◆ iAVec3T() [3/5]

template<typename T >
iAVec3T< T >::iAVec3T ( px,
py,
pz 
)
explicit

initialize vector from three values (of potentially different type)

◆ iAVec3T() [4/5]

template<typename T >
iAVec3T< T >::iAVec3T ( data[3])
explicit

initialize vector components from an array

◆ iAVec3T() [5/5]

template<typename T >
template<typename ParamType >
iAVec3T< T >::iAVec3T ( const iAVec3T< ParamType > &  v)

initialize vector components from another vector

Member Function Documentation

◆ data() [1/2]

template<typename T >
T * iAVec3T< T >::data

access to the raw array of size 3 holding the components

◆ data() [2/2]

template<typename T >
T const * iAVec3T< T >::data

access to the raw array of size 3 holding the components (const version)

◆ length()

template<typename T >
T iAVec3T< T >::length

get the length of the vector, alias for magnitude()

◆ magnitude()

template<typename T >
T iAVec3T< T >::magnitude

get the length of the vector

◆ normalize()

template<typename T >
void iAVec3T< T >::normalize

make this vector normalized, i.e. set the length to 1 but keep direction

◆ normalized()

template<typename T >
iAVec3T< T > iAVec3T< T >::normalized

get a normalize vector, i.e., a vector of length=1 pointing in the same direction

◆ operator*=() [1/2]

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator*= ( const iAVec3T< ParamType > &  v)

multiply another vector with this

◆ operator*=() [2/2]

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator*= ( ParamType  f)

multiply a constant to every component of this

◆ operator+()

template<typename T >
iAVec3T< T > iAVec3T< T >::operator+

unary + operator. Note: this is not handling the addition of two vectors! It just allows to write " +someVectorVariable" as an expression, it returns the vector itself

◆ operator+=()

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator+= ( const iAVec3T< ParamType > &  v)

add another vector to this

◆ operator-()

template<typename T >
iAVec3T< T > iAVec3T< T >::operator-

unary - operator. Writing "-someVectorVariable" returns a vector with all components of someVectorVariable multiplied by -1

◆ operator-=()

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator-= ( const iAVec3T< ParamType > &  v)

subtract another vector from this

◆ operator/=()

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator/= ( const iAVec3T< ParamType > &  v)

divide all components of this vector by the respective components of another vector

◆ operator=() [1/2]

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator= ( const iAVec3T< ParamType > &  v)

assign another vector

◆ operator=() [2/2]

template<typename T >
template<typename ParamType >
iAVec3T< T > & iAVec3T< T >::operator= ( ParamType  d)

assign a single value to all components

◆ operator[]() [1/2]

template<typename T >
T & iAVec3T< T >::operator[] ( size_t  index)

indexed read&write access to the components of this vector; index=0 -> x, index=1 -> y index=2 -> z

◆ operator[]() [2/2]

template<typename T >
const T & iAVec3T< T >::operator[] ( size_t  index) const

constant indexed access to the components of this vector; index=0 -> x, index=1 -> y index=2 -> z

◆ sqrMagnitude()

template<typename T >
T iAVec3T< T >::sqrMagnitude

get the squared length of the vector

◆ sum()

template<typename T >
T iAVec3T< T >::sum

get the sum of all vector components

◆ x()

template<typename T >
T iAVec3T< T >::x ( ) const
inline

access the x component of the vector

◆ y()

template<typename T >
T iAVec3T< T >::y ( ) const
inline

access the y component of the vector

◆ z()

template<typename T >
T iAVec3T< T >::z ( ) const
inline

access the z component of the vector


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