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

Protected Attributes

short vec [3]
 Storage for vector components.
 

Friends

INVENTOR_API SbVec3s operator* (const SbVec3s &v, int d)
 Component-wise binary scalar multiplication and division operators.
 
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.
 
INVENTOR_API SbVec3s operator- (const SbVec3s &v1, const SbVec3s &v2)
 
INVENTOR_API bool operator== (const SbVec3s &v1, const SbVec3s &v2)
 Equality comparison operator.
 
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() [2/3]

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

Definition at line 461 of file SbLinear.h.

References setValue().

◆ SbVec3s() [3/3]

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

Definition at line 464 of file SbLinear.h.

References setValue().

Member Function Documentation

◆ dot()

int32_t SbVec3s::dot ( const SbVec3s & v) const

References SbVec3s().

◆ getValue() [1/2]

const short * SbVec3s::getValue ( ) const
inline

Definition at line 470 of file SbLinear.h.

References vec.

◆ 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)

References SbVec3s().

◆ operator*=() [2/2]

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

References SbVec3s().

◆ operator+=()

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

References SbVec3s().

◆ operator-()

SbVec3s SbVec3s::operator- ( ) const

References SbVec3s().

◆ operator-=()

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

References SbVec3s().

◆ operator/=() [1/2]

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

Definition at line 493 of file SbLinear.h.

References SbVec3s().

◆ operator/=() [2/2]

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

References SbVec3s().

◆ operator[]() [1/2]

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

Definition at line 485 of file SbLinear.h.

References vec.

◆ operator[]() [2/2]

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

Definition at line 486 of file SbLinear.h.

References vec.

◆ setValue() [1/2]

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

References SbVec3s().

Referenced by SbVec3s(), and SbVec3s().

◆ setValue() [2/2]

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

References SbVec3s().

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 540 of file SbLinear.h.

References INVENTOR_API, and SbVec3s().

◆ operator* [1/4]

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

References INVENTOR_API, and SbVec3s().

◆ operator* [2/4]

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

References INVENTOR_API, and SbVec3s().

◆ operator* [3/4]

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

Definition at line 530 of file SbLinear.h.

References INVENTOR_API, and SbVec3s().

◆ operator* [4/4]

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

Definition at line 528 of file SbLinear.h.

References INVENTOR_API, and SbVec3s().

◆ operator+

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

References INVENTOR_API, and SbVec3s().

◆ operator-

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

References INVENTOR_API, and SbVec3s().

◆ operator/ [1/2]

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

Definition at line 533 of file SbLinear.h.

References INVENTOR_API, and SbVec3s().

◆ operator/ [2/2]

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

References INVENTOR_API, and SbVec3s().

◆ operator==

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

References INVENTOR_API, and SbVec3s().

Member Data Documentation

◆ vec

short SbVec3s::vec[3]
protected

Definition at line 522 of file SbLinear.h.

Referenced by getValue(), operator[](), operator[](), and SbVec3s().


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