4D vector class (double precision). More...
#include <Inventor/SbVec.h>
Public Member Functions | |
SbVec4d () | |
SbVec4d (const double v[4]) | |
SbVec4d (double x, double y, double z, double w) | |
double | dot (const SbVec4d &v) const |
void | getReal (SbVec3d &v) const |
const double * | getValue () const |
void | getValue (double &x, double &y, double &z, double &w) const |
double | length () const |
double | lengthSquared () const |
void | negate () |
double | normalize () |
SbVec4d & | setValue (const double v[4]) |
SbVec4d & | setValue (double x, double y, double z, double w) |
SbVec4d & | setValue (const SbVec4f &vec4f) |
SbVec4d & | operator*= (double d) |
SbVec4d & | operator/= (double d) |
SbVec4d & | operator+= (const SbVec4d &u) |
SbVec4d & | operator-= (const SbVec4d &u) |
SbVec4d | operator- () const |
SbBool | equals (const SbVec4d &v, double tolerance) const |
template<typename T > | |
SbVec4d (const T &v) | |
Friends | |
SbVec4d | operator* (const SbVec4d &v, double d) |
SbVec4d | operator* (double d, const SbVec4d &v) |
SbVec4d | operator/ (const SbVec4d &v, double d) |
SbVec4d | operator+ (const SbVec4d &v1, const SbVec4d &v2) |
SbVec4d | operator- (const SbVec4d &v1, const SbVec4d &v2) |
int | operator== (const SbVec4d &v1, const SbVec4d &v2) |
int | operator!= (const SbVec4d &v1, const SbVec4d &v2) |
std::ostream & | operator<< (std::ostream &os, const SbVec4d &v) |
| |
double & | operator[] (int i) |
const double & | operator[] (int i) const |
4D vector class used to store homogeneous coordinates. Although Open Inventor fields still store only single precision values, for certain applications it is useful and convenient to be able to store and manipulate double precision values, for example, double precision coordinate data or values that will be used for further computation.
SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us
SbVec4d::SbVec4d | ( | ) | [inline] |
Default constructor.
The vector is initialized with zeros.
SbVec4d::SbVec4d | ( | const double | v[4] | ) | [inline, explicit] |
Constructor given vector components.
SbVec4d::SbVec4d | ( | double | x, | |
double | y, | |||
double | z, | |||
double | w | |||
) | [inline] |
Constructor given vector components.
SbVec4d::SbVec4d | ( | const T & | v | ) | [inline, explicit] |
Constructor that converts an arbitrary SbVec4 to an SbVec4d.
double SbVec4d::dot | ( | const SbVec4d & | v | ) | const [inline] |
Returns dot (inner) product of vector and another vector.
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.
void SbVec4d::getReal | ( | SbVec3d & | v | ) | const |
Returns the real portion of the vector by dividing by the fourth value.
void SbVec4d::getValue | ( | double & | x, | |
double & | y, | |||
double & | z, | |||
double & | w | |||
) | const |
Returns vector components.
const double* SbVec4d::getValue | ( | ) | const [inline] |
Returns vector components.
double SbVec4d::length | ( | ) | const |
Returns geometric length of vector.
double SbVec4d::lengthSquared | ( | ) | const [inline] |
Returns square length of vector.
Faster than length().
void SbVec4d::negate | ( | ) |
Negates each component of vector in place.
double SbVec4d::normalize | ( | ) |
Changes vector to be unit length.
SbVec4d& SbVec4d::operator*= | ( | double | d | ) |
Component-wise scalar multiplication operator.
SbVec4d SbVec4d::operator- | ( | ) | const |
Nondestructive unary negation - returns a new vector.
SbVec4d& SbVec4d::operator/= | ( | double | d | ) |
Component-wise scalar division operator.
const double& SbVec4d::operator[] | ( | int | i | ) | const [inline] |
Accesses indexed component of vector.
double& SbVec4d::operator[] | ( | int | i | ) | [inline] |
Accesses indexed component of vector.
Sets value of vector from a single precision vector.
SbVec4d& SbVec4d::setValue | ( | double | x, | |
double | y, | |||
double | z, | |||
double | w | |||
) |
Sets the vector components.
SbVec4d& SbVec4d::setValue | ( | const double | v[4] | ) |
Sets the vector components.
Component-wise binary scalar multiplication operator.
Component-wise binary scalar multiplication operator.
Component-wise binary vector addition operator.
Component-wise binary vector subtraction operator.
Component-wise binary scalar division operator.
std::ostream& operator<< | ( | std::ostream & | os, | |
const SbVec4d & | v | |||
) | [friend] |
Writes the vector to the specified output stream.