Open Inventor Reference
|
2D vector class. More...
#include <Inventor/SbLinear.h>
Public Member Functions | |
SbVec2s () | |
Default constructor. | |
SbVec2s (const short v[2]) | |
Constructor given 2 components. | |
SbVec2s (short x, short y) | |
Constructor given 2 components. | |
int32_t | dot (const SbVec2s &v) const |
Returns dot (inner) product of vector and another vector. | |
const short * | getValue () const |
Returns vector components. | |
void | getValue (short &x, short &y) const |
Returns vector components. | |
void | negate () |
Negates each component of vector in place. | |
SbVec2s & | setValue (const short v[2]) |
Sets vector components. | |
SbVec2s & | setValue (short x, short y) |
Sets vector components. | |
short & | operator[] (int i) |
Accesses indexed component of vector. | |
const short & | operator[] (int i) const |
SbVec2s & | operator*= (int d) |
Component-wise scalar multiplication and division operators. | |
SbVec2s & | operator*= (double d) |
Component-wise scalar multiplication and division operators. | |
SbVec2s & | operator/= (int d) |
Component-wise scalar multiplication and division operators. | |
SbVec2s & | operator/= (double d) |
Component-wise scalar multiplication and division operators. | |
SbVec2s & | operator+= (const SbVec2s &u) |
Component-wise vector addition and subtraction operators. | |
SbVec2s & | operator-= (const SbVec2s &u) |
Component-wise vector addition and subtraction operators. | |
SbVec2s | operator- () const |
Nondestructive unary negation - returns a new vector. | |
Protected Attributes | |
short | vec [2] |
Storage for vector components. | |
Friends | |
INVENTOR_API SbVec2s | operator* (const SbVec2s &v, int d) |
Component-wise binary scalar multiplication and division operators. | |
INVENTOR_API SbVec2s | operator* (const SbVec2s &v, double d) |
INVENTOR_API SbVec2s | operator* (int d, const SbVec2s &v) |
INVENTOR_API SbVec2s | operator* (double d, const SbVec2s &v) |
INVENTOR_API SbVec2s | operator/ (const SbVec2s &v, int d) |
INVENTOR_API SbVec2s | operator/ (const SbVec2s &v, double d) |
INVENTOR_API SbVec2s | operator+ (const SbVec2s &v1, const SbVec2s &v2) |
Component-wise binary vector addition and subtraction operators. | |
INVENTOR_API SbVec2s | operator- (const SbVec2s &v1, const SbVec2s &v2) |
INVENTOR_API int | operator== (const SbVec2s &v1, const SbVec2s &v2) |
Equality comparison operator. | |
INVENTOR_API int | operator!= (const SbVec2s &v1, const SbVec2s &v2) |
2D vector class used to store 2D integer vectors and points. This class is used throughout Inventor for arguments and return values. {}
Definition at line 335 of file SbLinear.h.
SbVec2s::SbVec2s | ( | ) | [inline] |
Definition at line 339 of file SbLinear.h.
SbVec2s::SbVec2s | ( | const short | v[2] | ) | [inline] |
Definition at line 342 of file SbLinear.h.
SbVec2s::SbVec2s | ( | short | x, |
short | y | ||
) | [inline] |
Definition at line 345 of file SbLinear.h.
const short* SbVec2s::getValue | ( | ) | const [inline] |
Definition at line 351 of file SbLinear.h.
Referenced by SbBox2s::getBounds().
void SbVec2s::getValue | ( | short & | x, |
short & | y | ||
) | const |
void SbVec2s::negate | ( | ) |
SbVec2s& SbVec2s::operator*= | ( | int | d | ) |
SbVec2s& SbVec2s::operator*= | ( | double | d | ) |
SbVec2s SbVec2s::operator- | ( | ) | const |
SbVec2s& SbVec2s::operator/= | ( | int | d | ) |
SbVec2s& SbVec2s::operator/= | ( | double | d | ) | [inline] |
Definition at line 377 of file SbLinear.h.
const short& SbVec2s::operator[] | ( | int | i | ) | const [inline] |
Definition at line 367 of file SbLinear.h.
short& SbVec2s::operator[] | ( | int | i | ) | [inline] |
Definition at line 366 of file SbLinear.h.
SbVec2s& SbVec2s::setValue | ( | const short | v[2] | ) |
SbVec2s& SbVec2s::setValue | ( | short | x, |
short | y | ||
) |
Definition at line 406 of file SbLinear.h.
Definition at line 393 of file SbLinear.h.
Definition at line 391 of file SbLinear.h.
Definition at line 396 of file SbLinear.h.
short SbVec2s::vec[2] [protected] |
Definition at line 410 of file SbLinear.h.