Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SbVec4us Class Reference

VSG extension 4D vector class. More...

#include <Inventor/SbVec.h>

Public Member Functions

 SbVec4us ()
 Default constructor.
 
 SbVec4us (const unsigned short v[4])
 Constructor given 4 components.
 
 SbVec4us (unsigned short x, unsigned short y, unsigned short z, unsigned short w)
 Constructor given 4 components.
 
int32_t dot (const SbVec4us &v) const
 Returns dot (inner) product of vector and another vector.
 
const unsigned short * getValue () const
 Returns vector components.
 
void getValue (unsigned short &x, unsigned short &y, unsigned short &z, unsigned short &w) const
 Returns vector components.
 
void negate ()
 Negates each component of vector in place.
 
SbVec4ussetValue (const unsigned short v[4])
 Sets vector components.
 
SbVec4ussetValue (unsigned short x, unsigned short y, unsigned short z, unsigned short w)
 Sets vector components.
 
unsigned short & operator[] (int i)
 Accesses indexed component of vector.
 
const unsigned short & operator[] (int i) const
 
SbVec4usoperator*= (int d)
 Component-wise scalar multiplication operator.
 
SbVec4usoperator*= (double d)
 Component-wise scalar multiplication operator.
 
SbVec4usoperator/= (int d)
 Component-wise scalar division operator.
 
SbVec4usoperator/= (double d)
 Component-wise scalar division operator.
 
SbVec4usoperator+= (const SbVec4us &u)
 Component-wise vector addition operator.
 
SbVec4usoperator-= (const SbVec4us &u)
 Component-wise vector subtraction operator.
 
SbVec4us operator- () const
 Nondestructive unary negation - returns a new vector.
 
template<typename T >
 SbVec4us (const T &v)
 Constructor that converts an arbitrary SbVec4 to an SbVec4us.
 

Friends

SbVec4us operator* (const SbVec4us &v, int d)
 Component-wise binary scalar multiplication operator.
 
SbVec4us operator* (const SbVec4us &v, double d)
 Component-wise binary scalar multiplication operator.
 
SbVec4us operator* (int d, const SbVec4us &v)
 Component-wise binary scalar multiplication operator.
 
SbVec4us operator* (double d, const SbVec4us &v)
 Component-wise binary scalar multiplication operator.
 
SbVec4us operator/ (const SbVec4us &v, int d)
 Component-wise binary scalar division operator.
 
SbVec4us operator/ (const SbVec4us &v, double d)
 Component-wise binary scalar division operator.
 
SbVec4us operator+ (const SbVec4us &v1, const SbVec4us &v2)
 Component-wise binary vector addition operator.
 
SbVec4us operator- (const SbVec4us &v1, const SbVec4us &v2)
 Component-wise binary vector subtraction operator.
 
int operator== (const SbVec4us &v1, const SbVec4us &v2)
 Equality comparison operator.
 
int operator!= (const SbVec4us &v1, const SbVec4us &v2)
 Inequality comparison operator.
 
std::ostream & operator<< (std::ostream &os, const SbVec4us &v)
 Writes the vector to the specified output stream.
 

Detailed Description

VSG extension 4D vector class.

4D vector class used to store 4D integer vectors and points. This class is used throughout Open Inventor for arguments and return values.

SEE ALSO

SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32

Definition at line 3219 of file SbVec.h.

Constructor & Destructor Documentation

◆ SbVec4us() [1/4]

SbVec4us::SbVec4us ( )
inline

Default constructor.

The vector is initialized with zeros.

Definition at line 3225 of file SbVec.h.

◆ SbVec4us() [2/4]

SbVec4us::SbVec4us ( const unsigned short  v[4])
inlineexplicit

Constructor given 4 components.

Definition at line 3230 of file SbVec.h.

◆ SbVec4us() [3/4]

SbVec4us::SbVec4us ( unsigned short  x,
unsigned short  y,
unsigned short  z,
unsigned short  w 
)
inline

Constructor given 4 components.

Definition at line 3235 of file SbVec.h.

◆ SbVec4us() [4/4]

template<typename T >
SbVec4us::SbVec4us ( const T &  v)
inlineexplicit

Constructor that converts an arbitrary SbVec4 to an SbVec4us.

Definition at line 3367 of file SbVec.h.

Member Function Documentation

◆ dot()

int32_t SbVec4us::dot ( const SbVec4us v) const
inline

Returns dot (inner) product of vector and another vector.

Definition at line 3241 of file SbVec.h.

◆ getValue() [1/2]

const unsigned short * SbVec4us::getValue ( ) const
inline

Returns vector components.

Definition at line 3247 of file SbVec.h.

◆ getValue() [2/2]

void SbVec4us::getValue ( unsigned short &  x,
unsigned short &  y,
unsigned short &  z,
unsigned short &  w 
) const

Returns vector components.

◆ negate()

void SbVec4us::negate ( )

Negates each component of vector in place.

◆ operator*=() [1/2]

SbVec4us & SbVec4us::operator*= ( double  d)

Component-wise scalar multiplication operator.

◆ operator*=() [2/2]

SbVec4us & SbVec4us::operator*= ( int  d)

Component-wise scalar multiplication operator.

◆ operator+=()

SbVec4us & SbVec4us::operator+= ( const SbVec4us u)

Component-wise vector addition operator.

◆ operator-()

SbVec4us SbVec4us::operator- ( ) const

Nondestructive unary negation - returns a new vector.

◆ operator-=()

SbVec4us & SbVec4us::operator-= ( const SbVec4us u)

Component-wise vector subtraction operator.

◆ operator/=() [1/2]

SbVec4us & SbVec4us::operator/= ( double  d)
inline

Component-wise scalar division operator.

Definition at line 3293 of file SbVec.h.

◆ operator/=() [2/2]

SbVec4us & SbVec4us::operator/= ( int  d)

Component-wise scalar division operator.

◆ operator[]() [1/2]

unsigned short & SbVec4us::operator[] ( int  i)
inline

Accesses indexed component of vector.

Definition at line 3273 of file SbVec.h.

◆ operator[]() [2/2]

const unsigned short & SbVec4us::operator[] ( int  i) const
inline

Definition at line 3274 of file SbVec.h.

◆ setValue() [1/2]

SbVec4us & SbVec4us::setValue ( const unsigned short  v[4])

Sets vector components.

◆ setValue() [2/2]

SbVec4us & SbVec4us::setValue ( unsigned short  x,
unsigned short  y,
unsigned short  z,
unsigned short  w 
)

Sets vector components.

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const SbVec4us v1,
const SbVec4us v2 
)
friend

Inequality comparison operator.

Definition at line 3355 of file SbVec.h.

◆ operator* [1/4]

SbVec4us operator* ( const SbVec4us v,
double  d 
)
friend

Component-wise binary scalar multiplication operator.

◆ operator* [2/4]

SbVec4us operator* ( const SbVec4us v,
int  d 
)
friend

Component-wise binary scalar multiplication operator.

◆ operator* [3/4]

SbVec4us operator* ( double  d,
const SbVec4us v 
)
friend

Component-wise binary scalar multiplication operator.

Definition at line 3326 of file SbVec.h.

◆ operator* [4/4]

SbVec4us operator* ( int  d,
const SbVec4us v 
)
friend

Component-wise binary scalar multiplication operator.

Definition at line 3321 of file SbVec.h.

◆ operator+

SbVec4us operator+ ( const SbVec4us v1,
const SbVec4us v2 
)
friend

Component-wise binary vector addition operator.

◆ operator-

SbVec4us operator- ( const SbVec4us v1,
const SbVec4us v2 
)
friend

Component-wise binary vector subtraction operator.

◆ operator/ [1/2]

SbVec4us operator/ ( const SbVec4us v,
double  d 
)
friend

Component-wise binary scalar division operator.

Definition at line 3335 of file SbVec.h.

◆ operator/ [2/2]

SbVec4us operator/ ( const SbVec4us v,
int  d 
)
friend

Component-wise binary scalar division operator.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SbVec4us v 
)
friend

Writes the vector to the specified output stream.

Definition at line 3717 of file SbVec.h.

◆ operator==

int operator== ( const SbVec4us v1,
const SbVec4us v2 
)
friend

Equality comparison operator.


The documentation for this class was generated from the following file: