Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbVec2i32 Class Reference

2D vector class. More...

#include <Inventor/SbVec.h>

Public Member Functions

 SbVec2i32 ()
 Default constructor.
 
 SbVec2i32 (const int32_t v[2])
 Constructor given an array of 2 components.
 
 SbVec2i32 (int32_t x, int32_t y)
 Constructor given 2 individual components.
 
int32_t dot (const SbVec2i32 &v) const
 Returns dot (inner) product of vector and another vector.
 
const int32_t * getValue () const
 Returns pointer to array of 2 components.
 
void getValue (int32_t &x, int32_t &y) const
 Returns 2 individual components.
 
void negate ()
 Negates each component of vector in place.
 
SbVec2i32setValue (const int32_t v[2])
 Sets value of vector from array of 2 components.
 
SbVec2i32setValue (int32_t x, int32_t y)
 Sets value of vector from 2 individual components.
 
int32_t & operator[] (int i)
 Accesses indexed component of vector.
 
const int32_t & operator[] (int i) const
 Accesses indexed component of vector.
 
SbVec2i32operator*= (int d)
 Component-wise scalar multiplication operator.
 
SbVec2i32operator*= (double d)
 Component-wise scalar multiplication operator.
 
SbVec2i32operator/= (int d)
 Component-wise scalar division operator.
 
SbVec2i32operator/= (double d)
 Component-wise scalar division operator.
 
SbVec2i32operator+= (const SbVec2i32 &u)
 Component-wise vector addition operator.
 
SbVec2i32operator-= (const SbVec2i32 &u)
 Component-wise vector subtraction operator.
 
SbVec2i32 operator- () const
 Nondestructive unary negation - returns a new vector.
 
template<typename T >
 SbVec2i32 (const T &v)
 Constructor that converts an arbitrary SbVec2 to an SbVec2i32.
 

Friends

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

Detailed Description

2D vector class.

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

SEE ALSO

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

Definition at line 517 of file SbVec.h.

Constructor & Destructor Documentation

◆ SbVec2i32() [1/4]

SbVec2i32::SbVec2i32 ( )
inline

Default constructor.

The vector is initialized with zeros.

Definition at line 522 of file SbVec.h.

◆ SbVec2i32() [2/4]

SbVec2i32::SbVec2i32 ( const int32_t  v[2])
inlineexplicit

Constructor given an array of 2 components.

Definition at line 526 of file SbVec.h.

◆ SbVec2i32() [3/4]

SbVec2i32::SbVec2i32 ( int32_t  x,
int32_t  y 
)
inline

Constructor given 2 individual components.

Definition at line 530 of file SbVec.h.

◆ SbVec2i32() [4/4]

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

Constructor that converts an arbitrary SbVec2 to an SbVec2i32.

Definition at line 648 of file SbVec.h.

Member Function Documentation

◆ dot()

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

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

Definition at line 534 of file SbVec.h.

◆ getValue() [1/2]

const int32_t * SbVec2i32::getValue ( ) const
inline

Returns pointer to array of 2 components.

Definition at line 539 of file SbVec.h.

◆ getValue() [2/2]

void SbVec2i32::getValue ( int32_t &  x,
int32_t &  y 
) const

Returns 2 individual components.

◆ negate()

void SbVec2i32::negate ( )

Negates each component of vector in place.

◆ operator*=() [1/2]

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

Component-wise scalar multiplication operator.

◆ operator*=() [2/2]

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

Component-wise scalar multiplication operator.

◆ operator+=()

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

Component-wise vector addition operator.

◆ operator-()

SbVec2i32 SbVec2i32::operator- ( ) const

Nondestructive unary negation - returns a new vector.

◆ operator-=()

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

Component-wise vector subtraction operator.

◆ operator/=() [1/2]

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

Component-wise scalar division operator.

Definition at line 580 of file SbVec.h.

◆ operator/=() [2/2]

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

Component-wise scalar division operator.

◆ operator[]() [1/2]

int32_t & SbVec2i32::operator[] ( int  i)
inline

Accesses indexed component of vector.

Definition at line 559 of file SbVec.h.

◆ operator[]() [2/2]

const int32_t & SbVec2i32::operator[] ( int  i) const
inline

Accesses indexed component of vector.

Definition at line 563 of file SbVec.h.

◆ setValue() [1/2]

SbVec2i32 & SbVec2i32::setValue ( const int32_t  v[2])

Sets value of vector from array of 2 components.

◆ setValue() [2/2]

SbVec2i32 & SbVec2i32::setValue ( int32_t  x,
int32_t  y 
)

Sets value of vector from 2 individual components.

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 636 of file SbVec.h.

◆ operator* [1/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [2/4]

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

Component-wise binary scalar multiplication operator.

◆ operator* [3/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 610 of file SbVec.h.

◆ operator* [4/4]

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

Component-wise binary scalar multiplication operator.

Definition at line 605 of file SbVec.h.

◆ operator+

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

Component-wise binary vector addition operator.

◆ operator-

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

Component-wise binary vector subtraction operator.

◆ operator/ [1/2]

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

Component-wise binary scalar division operator.

Definition at line 619 of file SbVec.h.

◆ operator/ [2/2]

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

Component-wise binary scalar division operator.

◆ operator<<

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

Writes the vector to the specified output stream.

Definition at line 3604 of file SbVec.h.

◆ operator==

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

Equality comparison operator.


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