![]() |
open_iA 2021.08
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
Class representing a 3-dimensional vector. More...
#include <iAVec3.h>
Public Member Functions | |
| 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... | |
| 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... | |
| template<typename ParamType > | |
| iAVec3T< T > & | fill (ParamType d) |
| assign a single value to all components More... | |
| T | length () const |
| get the length of the vector, alias for magnitude() More... | |
| T | 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... | |
| 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... | |
| T | sqrMagnitude () const |
| get the squared length of the vector More... | |
| T | sum () const |
| get the sum of all vector components More... | |
| T | x () const |
| access the x component of the vector More... | |
| T | y () const |
| access the y component of the vector More... | |
| T | z () const |
| access the z component of the vector More... | |
Class representing a 3-dimensional vector.
initialize all vector components to the same value
initialize vector from three values (of potentially different type)
initialize vector components from an array
| iAVec3T< T >::iAVec3T | ( | const iAVec3T< ParamType > & | v | ) |
initialize vector components from another vector
| T * iAVec3T< T >::data |
access to the raw array of size 3 holding the components
| T const * iAVec3T< T >::data |
access to the raw array of size 3 holding the components (const version)
| iAVec3T< T > & iAVec3T< T >::fill | ( | ParamType | d | ) |
assign a single value to all components
| T iAVec3T< T >::length |
get the length of the vector, alias for magnitude()
| T iAVec3T< T >::magnitude |
get the length of the vector
| void iAVec3T< T >::normalize |
make this vector normalized, i.e. set the length to 1 but keep direction
get a normalize vector, i.e., a vector of length=1 pointing in the same direction
| iAVec3T< T > & iAVec3T< T >::operator*= | ( | const iAVec3T< ParamType > & | v | ) |
multiply another vector with this
| iAVec3T< T > & iAVec3T< T >::operator*= | ( | ParamType | f | ) |
multiply a constant to every component of this
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
| iAVec3T< T > & iAVec3T< T >::operator+= | ( | const iAVec3T< ParamType > & | v | ) |
add another vector to this
unary - operator. Writing "-someVectorVariable" returns a vector with all components of someVectorVariable multiplied by -1
| iAVec3T< T > & iAVec3T< T >::operator-= | ( | const iAVec3T< ParamType > & | v | ) |
subtract another vector from this
| iAVec3T< T > & iAVec3T< T >::operator/= | ( | const iAVec3T< ParamType > & | v | ) |
divide all components of this vector by the respective components of another vector
| iAVec3T< T > & iAVec3T< T >::operator= | ( | const iAVec3T< ParamType > & | v | ) |
assign another vector
| 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
| 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
| T iAVec3T< T >::sqrMagnitude |
get the squared length of the vector
| T iAVec3T< T >::sum |
get the sum of all vector components
|
inline |
access the x component of the vector
|
inline |
access the y component of the vector
|
inline |
access the z component of the vector