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

VSG extension 4D vector class. More...

#include <Inventor/SbVec.h>

Public Member Functions

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

Friends

SbVec4ub operator* (const SbVec4ub &v, int d)
 Component-wise binary scalar multiplication operator.
 
SbVec4ub operator* (const SbVec4ub &v, double d)
 Component-wise binary scalar multiplication operator.
 
SbVec4ub operator* (int d, const SbVec4ub &v)
 Component-wise binary scalar multiplication operator.
 
SbVec4ub operator* (double d, const SbVec4ub &v)
 Component-wise binary scalar multiplication operator.
 
SbVec4ub operator/ (const SbVec4ub &v, int d)
 Component-wise binary scalar division operator.
 
SbVec4ub operator/ (const SbVec4ub &v, double d)
 Component-wise binary scalar division operator.
 
SbVec4ub operator+ (const SbVec4ub &v1, const SbVec4ub &v2)
 Component-wise binary vector addition operator.
 
SbVec4ub operator- (const SbVec4ub &v1, const SbVec4ub &v2)
 Component-wise binary vector subtraction operator.
 
int operator== (const SbVec4ub &v1, const SbVec4ub &v2)
 Equality comparison operator.
 
int operator!= (const SbVec4ub &v1, const SbVec4ub &v2)
 Inequality comparison operator.
 
std::ostream & operator<< (std::ostream &os, const SbVec4ub &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, SbVec4ui32, SbVec4us

Definition at line 3421 of file SbVec.h.

Constructor & Destructor Documentation

◆ SbVec4ub() [1/4]

SbVec4ub::SbVec4ub ( )
inline

Default constructor.

The vector is initialized with zeros.

Definition at line 3427 of file SbVec.h.

◆ SbVec4ub() [2/4]

SbVec4ub::SbVec4ub ( const unsigned char  v[4])
inlineexplicit

Constructor given 4 components.

Definition at line 3432 of file SbVec.h.

◆ SbVec4ub() [3/4]

SbVec4ub::SbVec4ub ( unsigned char  x,
unsigned char  y,
unsigned char  z,
unsigned char  w 
)
inline

Constructor given 4 components.

Definition at line 3437 of file SbVec.h.

◆ SbVec4ub() [4/4]

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

Constructor that converts an arbitrary SbVec4 to an SbVec4ub.

Definition at line 3569 of file SbVec.h.

Member Function Documentation

◆ clamp()

void SbVec4ub::clamp ( unsigned char  a,
unsigned char  b 
)
inline

Clamp each component between a and b.

Definition at line 3581 of file SbVec.h.

◆ dot()

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

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

Definition at line 3443 of file SbVec.h.

◆ getValue() [1/2]

const unsigned char * SbVec4ub::getValue ( ) const
inline

Returns vector components.

Definition at line 3449 of file SbVec.h.

◆ getValue() [2/2]

void SbVec4ub::getValue ( unsigned char &  x,
unsigned char &  y,
unsigned char &  z,
unsigned char &  w 
) const

Returns vector components.

◆ negate()

void SbVec4ub::negate ( )

Negates each component of vector in place.

◆ operator*=() [1/2]

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

Component-wise scalar multiplication operator.

◆ operator*=() [2/2]

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

Component-wise scalar multiplication operator.

◆ operator+=()

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

Component-wise vector addition operator.

◆ operator-()

SbVec4ub SbVec4ub::operator- ( ) const

Nondestructive unary negation - returns a new vector.

◆ operator-=()

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

Component-wise vector subtraction operator.

◆ operator/=() [1/2]

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

Component-wise scalar division operator.

Definition at line 3495 of file SbVec.h.

◆ operator/=() [2/2]

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

Component-wise scalar division operator.

◆ operator[]() [1/2]

unsigned char & SbVec4ub::operator[] ( int  i)
inline

Accesses indexed component of vector.

Definition at line 3475 of file SbVec.h.

◆ operator[]() [2/2]

const unsigned char & SbVec4ub::operator[] ( int  i) const
inline

Definition at line 3476 of file SbVec.h.

◆ setValue() [1/2]

SbVec4ub & SbVec4ub::setValue ( const unsigned char  v[4])

Sets vector components.

◆ setValue() [2/2]

SbVec4ub & SbVec4ub::setValue ( unsigned char  x,
unsigned char  y,
unsigned char  z,
unsigned char  w 
)

Sets vector components.

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 3557 of file SbVec.h.

◆ operator* [1/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [2/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [3/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 3528 of file SbVec.h.

◆ operator* [4/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 3523 of file SbVec.h.

◆ operator+

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

Component-wise binary vector addition operator.

◆ operator-

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

Component-wise binary vector subtraction operator.

◆ operator/ [1/2]

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

Component-wise binary scalar division operator.

Definition at line 3537 of file SbVec.h.

◆ operator/ [2/2]

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

Component-wise binary scalar division operator.

◆ operator<<

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

Writes the vector to the specified output stream.

Definition at line 3701 of file SbVec.h.

◆ operator==

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

Equality comparison operator.


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