Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbVec3s Class Reference

VSG extension 3D vector class. More...

#include <Inventor/SbVec.h>

Public Member Functions

 SbVec3s ()
 Default constructor.
 
 SbVec3s (const short v[3])
 Constructor given 3 components.
 
 SbVec3s (short x, short y, short z)
 Constructor given 3 components.
 
 SbVec3s (const SbVec3i32 &v)
 Constructor given an SbVec3i32 (adapter).
 
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 vector components.
 
SbVec3ssetValue (short x, short y, short z)
 Sets vector components.
 
short & operator[] (int i)
 Accesses indexed component of vector.
 
const short & operator[] (int i) const
 
SbVec3soperator*= (int d)
 Component-wise scalar multiplication operator.
 
SbVec3soperator*= (double d)
 Component-wise scalar multiplication operator.
 
SbVec3soperator/= (int d)
 Component-wise scalar division operator.
 
SbVec3soperator/= (double d)
 Component-wise scalar division operator.
 
SbVec3soperator+= (const SbVec3s &u)
 Component-wise vector addition operator.
 
SbVec3soperator-= (const SbVec3s &u)
 Component-wise vector subtraction operator.
 
SbVec3s operator- () const
 Nondestructive unary negation - returns a new vector.
 
SbVec3s operator= (const SbVec3i32 &v)
 Assignment operator given SbVec3i32 (adapter).
 
template<typename T >
 SbVec3s (const T &v)
 Constructor that converts an arbitrary SbVec3 to an SbVec3s.
 

Friends

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

Detailed Description

VSG extension 3D vector class.

3D vector class used to store 3D 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, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us

Definition at line 1797 of file SbVec.h.

Constructor & Destructor Documentation

◆ SbVec3s() [1/5]

SbVec3s::SbVec3s ( )
inline

Default constructor.

The vector is initialized with zeros.

Definition at line 1803 of file SbVec.h.

◆ SbVec3s() [2/5]

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

Constructor given 3 components.

Definition at line 1808 of file SbVec.h.

◆ SbVec3s() [3/5]

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

Constructor given 3 components.

Definition at line 1813 of file SbVec.h.

◆ SbVec3s() [4/5]

SbVec3s::SbVec3s ( const SbVec3i32 v)

Constructor given an SbVec3i32 (adapter).

Note possible loss of data.

◆ SbVec3s() [5/5]

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

Constructor that converts an arbitrary SbVec3 to an SbVec3s.

Definition at line 1960 of file SbVec.h.

Member Function Documentation

◆ dot()

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

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

Definition at line 1826 of file SbVec.h.

◆ getValue() [1/2]

const short * SbVec3s::getValue ( ) const
inline

Returns vector components.

Definition at line 1832 of file SbVec.h.

◆ getValue() [2/2]

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

Returns vector components.

◆ negate()

void SbVec3s::negate ( )

Negates each component of vector in place.

◆ operator*=() [1/2]

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

Component-wise scalar multiplication operator.

◆ operator*=() [2/2]

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

Component-wise scalar multiplication operator.

◆ operator+=()

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

Component-wise vector addition operator.

◆ operator-()

SbVec3s SbVec3s::operator- ( ) const

Nondestructive unary negation - returns a new vector.

◆ operator-=()

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

Component-wise vector subtraction operator.

◆ operator/=() [1/2]

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

Component-wise scalar division operator.

Definition at line 1878 of file SbVec.h.

◆ operator/=() [2/2]

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

Component-wise scalar division operator.

◆ operator=()

SbVec3s SbVec3s::operator= ( const SbVec3i32 v)

Assignment operator given SbVec3i32 (adapter).

Note possible loss of data.

◆ operator[]() [1/2]

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

Accesses indexed component of vector.

Definition at line 1858 of file SbVec.h.

◆ operator[]() [2/2]

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

Definition at line 1859 of file SbVec.h.

◆ setValue() [1/2]

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

Sets vector components.

◆ setValue() [2/2]

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

Sets vector components.

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 1948 of file SbVec.h.

◆ operator* [1/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [2/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [3/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 1919 of file SbVec.h.

◆ operator* [4/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 1914 of file SbVec.h.

◆ operator+

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

Component-wise binary vector addition operator.

◆ operator-

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

Component-wise binary vector subtraction operator.

◆ operator/ [1/2]

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

Component-wise binary scalar division operator.

Definition at line 1928 of file SbVec.h.

◆ operator/ [2/2]

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

Component-wise binary scalar division operator.

◆ operator<<

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

Writes the vector to the specified output stream.

Definition at line 3628 of file SbVec.h.

◆ operator==

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

Equality comparison operator.


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