Open Inventor Reference
|
2D vector class with double members. More...
#include <Inventor/SbLineard.h>
Public Member Functions | |
SbVec2d () | |
Default constructor. More... | |
SbVec2d (const double v[2]) | |
Constructor given vector components. More... | |
SbVec2d (double x, double y) | |
Constructor given vector components. More... | |
double | dot (const SbVec2d &v) const |
Returns dot (inner) product of vector and another vector. More... | |
const double * | getValue () const |
Returns vector components. More... | |
void | getValue (double &x, double &y) const |
Returns vector components. More... | |
double | length () const |
Returns geometric length of vector. More... | |
void | negate () |
Negates each component of vector in place. More... | |
double | normalize () |
Changes vector to be unit length. More... | |
SbVec2d & | setValue (const double v[2]) |
Sets the vector components. More... | |
SbVec2d & | setValue (double x, double y) |
Sets the vector components. More... | |
double & | operator[] (int i) |
Accesses indexed component of vector. More... | |
const double & | operator[] (int i) const |
SbVec2d & | operator*= (double d) |
Component-wise scalar multiplication and division operators. More... | |
SbVec2d & | operator/= (double d) |
Component-wise scalar multiplication and division operators. More... | |
SbVec2d & | operator+= (const SbVec2d &u) |
Component-wise vector addition and subtraction operators. More... | |
SbVec2d & | operator-= (const SbVec2d &u) |
Component-wise vector addition and subtraction operators. More... | |
SbVec2d | operator- () const |
Nondestructive unary negation - returns a new vector. More... | |
bool | equals (const SbVec2d v, double tolerance) const |
Equality comparison within given tolerance em the square of the length of the maximum distance between the two vectors. More... | |
Protected Attributes | |
double | vec [2] |
Storage for vector components. More... | |
Friends | |
INVENTOR_API SbVec2d | operator* (const SbVec2d &v, double d) |
Component-wise binary scalar multiplication and division operators. More... | |
INVENTOR_API SbVec2d | operator* (double d, const SbVec2d &v) |
INVENTOR_API SbVec2d | operator/ (const SbVec2d &v, double d) |
INVENTOR_API SbVec2d | operator+ (const SbVec2d &v1, const SbVec2d &v2) |
Component-wise binary vector addition and subtraction operators. More... | |
INVENTOR_API SbVec2d | operator- (const SbVec2d &v1, const SbVec2d &v2) |
INVENTOR_API bool | operator== (const SbVec2d &v1, const SbVec2d &v2) |
Equality comparison operator. More... | |
INVENTOR_API bool | operator!= (const SbVec2d &v1, const SbVec2d &v2) |
2D vector class used to store 2D vectors and points. This class is used throughout Inventor for arguments and return values. {}
Definition at line 242 of file SbLineard.h.
|
inline |
Definition at line 246 of file SbLineard.h.
|
inline |
Definition at line 249 of file SbLineard.h.
|
inline |
Definition at line 252 of file SbLineard.h.
double SbVec2d::dot | ( | const SbVec2d & | v | ) | const |
bool SbVec2d::equals | ( | const SbVec2d | v, |
double | tolerance | ||
) | const |
|
inline |
Definition at line 258 of file SbLineard.h.
void SbVec2d::getValue | ( | double & | x, |
double & | y | ||
) | const |
double SbVec2d::length | ( | ) | const |
void SbVec2d::negate | ( | ) |
double SbVec2d::normalize | ( | ) |
SbVec2d& SbVec2d::operator*= | ( | double | d | ) |
SbVec2d SbVec2d::operator- | ( | ) | const |
|
inline |
Definition at line 286 of file SbLineard.h.
|
inline |
Definition at line 279 of file SbLineard.h.
|
inline |
Definition at line 280 of file SbLineard.h.
SbVec2d& SbVec2d::setValue | ( | const double | v[2] | ) |
SbVec2d& SbVec2d::setValue | ( | double | x, |
double | y | ||
) |
|
friend |
Definition at line 329 of file SbLineard.h.
|
friend |
|
friend |
Definition at line 320 of file SbLineard.h.
|
friend |
|
friend |
|
friend |
Definition at line 322 of file SbLineard.h.
|
friend |
|
protected |
Definition at line 316 of file SbLineard.h.