Class defining a vector or a point of 3 coordinates. More...
#include <MeshVizXLM/MbVec3.h>
Public Types | |
typedef _T | ValueType |
Public Member Functions | |
MbVec3 () | |
MbVec3 (const _T v[3]) | |
MbVec3 (_T x, _T y, _T z) | |
template<typename _Type > | |
MbVec3 (_Type x, _Type y, _Type z) | |
MbVec3 (char v) | |
MbVec3 (unsigned char v) | |
MbVec3 (short v) | |
MbVec3 (unsigned short v) | |
MbVec3 (int v) | |
MbVec3 (size_t v) | |
MbVec3 (long v) | |
MbVec3 (float v) | |
MbVec3 (double v) | |
MbVec3 (long double v) | |
template<typename _MbVec3T > | |
MbVec3 (const _MbVec3T &v) | |
MbVec3 | cross (const MbVec3< _T > &v) const |
_T | dot (const MbVec3< _T > &v) const |
const _T * | getValue () const |
void | getValue (_T &x, _T &y, _T &z) const |
_T | length () const |
_T | normalize () |
void | negate () |
MbVec3 | mult (const MbVec3< _T > &v) const |
MbVec3 | div (const MbVec3< _T > &v) const |
MbVec3< _T > & | setValue (const _T v[3]) |
MbVec3< _T > & | setValue (_T x, _T y, _T z) |
MbVec3 & | operator= (_T d) |
MbVec3 & | operator*= (_T d) |
MbVec3 & | operator/= (_T d) |
MbVec3 & | operator+= (const MbVec3 &v) |
MbVec3 & | operator-= (const MbVec3 &v) |
MbVec3 | operator- () const |
bool | equals (const MbVec3 &v, _T tolerance) const |
bool | equals (const MbVec3 &v) const |
Static Public Member Functions | |
static MbVec3 | numeric_limit_max () |
Friends | |
MbVec3 | operator* (const MbVec3 &v1, const MbVec3 &v2) |
MbVec3 | operator* (const MbVec3 &v, _T d) |
MbVec3 | operator* (_T d, const MbVec3 &v) |
MbVec3 | operator/ (const MbVec3 &v, _T d) |
MbVec3 | operator/ (const MbVec3 &v1, const MbVec3 &v2) |
MbVec3 | operator+ (const MbVec3 &v1, const MbVec3 &v2) |
MbVec3 | operator+ (const MbVec3 &v, _T d) |
MbVec3 | operator+ (_T d, const MbVec3 &v) |
MbVec3 | operator- (const MbVec3 &v1, const MbVec3 &v2) |
MbVec3 | operator- (const MbVec3 &v, _T d) |
MbVec3 | sqrt (const MbVec3 &v) |
bool | operator== (const MbVec3 &v1, const MbVec3 &v2) |
bool | operator!= (const MbVec3 &v1, const MbVec3 &v2) |
bool | operator< (const MbVec3 &v1, const MbVec3 &v2) |
bool | operator<= (const MbVec3 &v1, const MbVec3 &v2) |
bool | operator> (const MbVec3 &v1, const MbVec3 &v2) |
bool | operator>= (const MbVec3 &v1, const MbVec3 &v2) |
bool | areCollinear (const MbVec3< _T > &v1, const MbVec3< _T > &v2, _T tol) |
bool | areCollinear (const MbVec3< _T > &v1, const MbVec3< _T > &v2) |
std::ostream & | operator<< (std::ostream &os, const MbVec3 &v) |
| |
_T & | operator[] (int i) |
const _T & | operator[] (int i) const |
_T & | operator[] (size_t i) |
const _T & | operator[] (size_t i) const |
3D vector class used to store 3D vectors and points. This class is similar to the standard Open Inventor SbVec3 classes, but exists to allow MeshViz Extraction to be used independently of Open Inventor.
Constructor (vector is initialized to zero values).
MbVec3< _T >::MbVec3 | ( | _Type | x, | |
_Type | y, | |||
_Type | z | |||
) | [inline] |
MbVec3< _T >::MbVec3 | ( | const _MbVec3T & | v | ) | [inline, explicit] |
Constructor.
Returns right-handed cross product of vector and another vector.
Component-wise vector division.
Returns dot (inner) product of vector and another vector.
Equality comparison within the machine epsilon given by the numeric_limits<_T> Square of the length of the maximum distance between the two vectors.
bool MbVec3< _T >::equals | ( | const MbVec3< _T > & | v, | |
_T | tolerance | |||
) | const [inline] |
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.
void MbVec3< _T >::getValue | ( | _T & | x, | |
_T & | y, | |||
_T & | z | |||
) | const [inline] |
Returns vector components.
const _T* MbVec3< _T >::getValue | ( | ) | const [inline] |
Returns pointer to vector components.
_T MbVec3< _T >::length | ( | ) | const [inline] |
Returns geometric length of vector.
Component-wise vector multiplication.
void MbVec3< _T >::negate | ( | ) | [inline] |
Negates each component of vector in place.
_T MbVec3< _T >::normalize | ( | ) | [inline] |
Changes vector to be unit length, returning the length before normalization.
Returns the maximum value for a vector.
Component-wise scalar multiplication operator.
Component-wise vector addition operator.
Nondestructive unary negation - returns a new vector.
Component-wise vector subtraction operator.
Component-wise scalar division operator.
Component-wise setting.
All components are set to d.
const _T& MbVec3< _T >::operator[] | ( | size_t | i | ) | const [inline] |
Accesses indexed component of vector.
_T& MbVec3< _T >::operator[] | ( | size_t | i | ) | [inline] |
Accesses indexed component of vector.
const _T& MbVec3< _T >::operator[] | ( | int | i | ) | const [inline] |
Accesses indexed component of vector.
_T& MbVec3< _T >::operator[] | ( | int | i | ) | [inline] |
Accesses indexed component of vector.
Sets the vector components.
Sets the vector components.
bool areCollinear | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2 | |||
) | [friend] |
Returns true if vectors are collinear within the machine epsilon given by the numeric_limits<_T>.
bool areCollinear | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2, | |||
_T | tol | |||
) | [friend] |
Returns true if vectors are collinear within the given tolerance.
Inequality comparison operator.
Component-wise binary scalar multiplication operator.
Component-wise binary scalar multiplication operator.
MbVec3 operator* | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2 | |||
) | [friend] |
Component-wise vector multiplication operator.
Component-wise binary scalar addition operator.
Component-wise binary scalar addition operator.
MbVec3 operator+ | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2 | |||
) | [friend] |
Component-wise binary vector addition operator.
Component-wise binary scalar subtraction operator.
MbVec3 operator- | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2 | |||
) | [friend] |
Component-wise binary vector subtraction operator.
MbVec3 operator/ | ( | const MbVec3< _T > & | v1, | |
const MbVec3< _T > & | v2 | |||
) | [friend] |
Component-wise vector division operator.
Component-wise binary scalar division operator.
Length comparison operator.
std::ostream& operator<< | ( | std::ostream & | os, | |
const MbVec3< _T > & | v | |||
) | [friend] |
Writes the vector to the specified output stream.
Length comparison operator.
Equality comparison operator.
Length comparison operator.
Length comparison operator.
Component-wise vector square root operator.