Open Inventor Reference
SbVec3s Class Reference

3D vector used to represet points or directions. More...

#include <Inventor/SbLinear.h>

Public Member Functions

 SbVec3s ()
 Default constructor. More...
 
 SbVec3s (const short v[3])
 Constructor given an array of 3 components. More...
 
 SbVec3s (short x, short y, short z)
 Constructor given 3 individual components. More...
 
int32_t dot (const SbVec3s &v) const
 Returns dot (inner) product of vector and another vector. More...
 
const short * getValue () const
 Returns vector components. More...
 
void getValue (short &x, short &y, short &z) const
 Returns vector components. More...
 
void negate ()
 Negates each component of vector in place. More...
 
SbVec3ssetValue (const short v[3])
 Sets value of vector from array of 3 components. More...
 
SbVec3ssetValue (short x, short y, short z)
 Sets value of vector from 3 individual components. More...
 
short & operator[] (int i)
 Accesses indexed component of vector. More...
 
const short & operator[] (int i) const
 
SbVec3soperator*= (int d)
 Component-wise scalar multiplication and division operators. More...
 
SbVec3soperator*= (double d)
 
SbVec3soperator/= (int d)
 
SbVec3soperator/= (double d)
 
SbVec3soperator+= (const SbVec3s &u)
 Component-wise vector addition and subtraction operators. More...
 
SbVec3soperator-= (const SbVec3s &u)
 Component-wise vector addition and subtraction operators. More...
 
SbVec3s operator- () const
 Nondestructive unary negation - returns a new vector. More...
 

Protected Attributes

short vec [3]
 Storage for vector components. More...
 

Friends

INVENTOR_API SbVec3s operator* (const SbVec3s &v, int d)
 Component-wise binary scalar multiplication and division operators. More...
 
INVENTOR_API SbVec3s operator* (const SbVec3s &v, double d)
 
INVENTOR_API SbVec3s operator* (int d, const SbVec3s &v)
 
INVENTOR_API SbVec3s operator* (double d, const SbVec3s &v)
 
INVENTOR_API SbVec3s operator/ (const SbVec3s &v, int d)
 
INVENTOR_API SbVec3s operator/ (const SbVec3s &v, double d)
 
INVENTOR_API SbVec3s operator+ (const SbVec3s &v1, const SbVec3s &v2)
 Component-wise binary vector addition and subtraction operators. More...
 
INVENTOR_API SbVec3s operator- (const SbVec3s &v1, const SbVec3s &v2)
 
INVENTOR_API bool operator== (const SbVec3s &v1, const SbVec3s &v2)
 Equality comparison operator. More...
 
INVENTOR_API bool operator!= (const SbVec3s &v1, const SbVec3s &v2)
 

Detailed Description

Each component of the vector is a (short) integer.

Definition at line 454 of file SbLinear.h.

Constructor & Destructor Documentation

◆ SbVec3s() [1/3]

SbVec3s::SbVec3s ( )
inline

Definition at line 458 of file SbLinear.h.

◆ SbVec3s() [2/3]

SbVec3s::SbVec3s ( const short  v[3])
inline

Definition at line 461 of file SbLinear.h.

◆ SbVec3s() [3/3]

SbVec3s::SbVec3s ( short  x,
short  y,
short  z 
)
inline

Definition at line 464 of file SbLinear.h.

Member Function Documentation

◆ dot()

int32_t SbVec3s::dot ( const SbVec3s v) const

◆ getValue() [1/2]

const short* SbVec3s::getValue ( ) const
inline

Definition at line 470 of file SbLinear.h.

◆ getValue() [2/2]

void SbVec3s::getValue ( short &  x,
short &  y,
short &  z 
) const

◆ negate()

void SbVec3s::negate ( )

◆ operator*=() [1/2]

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

◆ operator*=() [2/2]

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

◆ operator+=()

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

◆ operator-()

SbVec3s SbVec3s::operator- ( ) const

◆ operator-=()

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

◆ operator/=() [1/2]

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

Definition at line 493 of file SbLinear.h.

◆ operator/=() [2/2]

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

◆ operator[]() [1/2]

short& SbVec3s::operator[] ( int  i)
inline

Definition at line 485 of file SbLinear.h.

◆ operator[]() [2/2]

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

Definition at line 486 of file SbLinear.h.

◆ setValue() [1/2]

SbVec3s& SbVec3s::setValue ( const short  v[3])

◆ setValue() [2/2]

SbVec3s& SbVec3s::setValue ( short  x,
short  y,
short  z 
)

Friends And Related Function Documentation

◆ operator!=

INVENTOR_API bool operator!= ( const SbVec3s v1,
const SbVec3s v2 
)
friend

Definition at line 540 of file SbLinear.h.

◆ operator* [1/4]

INVENTOR_API SbVec3s operator* ( const SbVec3s v,
double  d 
)
friend

◆ operator* [2/4]

INVENTOR_API SbVec3s operator* ( const SbVec3s v,
int  d 
)
friend

◆ operator* [3/4]

INVENTOR_API SbVec3s operator* ( double  d,
const SbVec3s v 
)
friend

Definition at line 530 of file SbLinear.h.

◆ operator* [4/4]

INVENTOR_API SbVec3s operator* ( int  d,
const SbVec3s v 
)
friend

Definition at line 528 of file SbLinear.h.

◆ operator+

INVENTOR_API SbVec3s operator+ ( const SbVec3s v1,
const SbVec3s v2 
)
friend

◆ operator-

INVENTOR_API SbVec3s operator- ( const SbVec3s v1,
const SbVec3s v2 
)
friend

◆ operator/ [1/2]

INVENTOR_API SbVec3s operator/ ( const SbVec3s v,
double  d 
)
friend

Definition at line 533 of file SbLinear.h.

◆ operator/ [2/2]

INVENTOR_API SbVec3s operator/ ( const SbVec3s v,
int  d 
)
friend

◆ operator==

INVENTOR_API bool operator== ( const SbVec3s v1,
const SbVec3s v2 
)
friend

Member Data Documentation

◆ vec

short SbVec3s::vec[3]
protected

Definition at line 522 of file SbLinear.h.


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