SbVec2s Class Reference
[Basics]

2D vector class. More...

#include <Inventor/SbVec.h>

List of all members.

Public Member Functions

 SbVec2s ()
 SbVec2s (const short v[2])
 SbVec2s (short x, short y)
 SbVec2s (const SbVec2i32 &v)
int32_t dot (const SbVec2s &v) const
const short * getValue () const
void getValue (short &x, short &y) const
void negate ()
SbVec2ssetValue (const short v[2])
SbVec2ssetValue (short x, short y)
SbVec2soperator*= (int d)
SbVec2soperator*= (double d)
SbVec2soperator/= (int d)
SbVec2soperator/= (double d)
SbVec2soperator+= (const SbVec2s &u)
SbVec2soperator-= (const SbVec2s &u)
SbVec2s operator- () const
SbVec2s operator= (const SbVec2i32 &v)
template<typename T >
 SbVec2s (const T &v)

Friends

SbVec2s operator* (const SbVec2s &v, int d)
SbVec2s operator* (const SbVec2s &v, double d)
SbVec2s operator* (int d, const SbVec2s &v)
SbVec2s operator* (double d, const SbVec2s &v)
SbVec2s operator/ (const SbVec2s &v, int d)
SbVec2s operator/ (const SbVec2s &v, double d)
SbVec2s operator+ (const SbVec2s &v1, const SbVec2s &v2)
SbVec2s operator- (const SbVec2s &v1, const SbVec2s &v2)
int operator== (const SbVec2s &v1, const SbVec2s &v2)
int operator!= (const SbVec2s &v1, const SbVec2s &v2)
std::ostream & operator<< (std::ostream &os, const SbVec2s &v)



short & operator[] (int i)
const short & operator[] (int i) const

Detailed Description

2D vector class.

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

SEE ALSO

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


Constructor & Destructor Documentation

SbVec2s::SbVec2s (  )  [inline]

Default constructor.

The vector is not initialized.

SbVec2s::SbVec2s ( const short  v[2]  )  [inline]

Constructor given 2 components.

SbVec2s::SbVec2s ( short  x,
short  y 
) [inline]

Constructor given 2 components.

SbVec2s::SbVec2s ( const SbVec2i32 v  )  [explicit]

Constructor given an SbVec2i32.

template<typename T >
SbVec2s::SbVec2s ( const T &  v  )  [inline, explicit]

Constructor that converts an arbitrary SbVec2 to an SbVec2s.


Member Function Documentation

int32_t SbVec2s::dot ( const SbVec2s v  )  const [inline]

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

void SbVec2s::getValue ( short &  x,
short &  y 
) const

Returns vector components.

const short* SbVec2s::getValue (  )  const [inline]

Returns vector components.

void SbVec2s::negate (  ) 

Negates each component of vector in place.

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

Component-wise scalar multiplication operator.

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

Component-wise scalar multiplication operator.

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

Component-wise vector addition operator.

SbVec2s SbVec2s::operator- (  )  const

Nondestructive unary negation - returns a new vector.

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

Component-wise vector subtraction operator.

SbVec2s& SbVec2s::operator/= ( double  d  )  [inline]

Component-wise scalar division operator.

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

Component-wise scalar division operator.

SbVec2s SbVec2s::operator= ( const SbVec2i32 v  ) 

Component-wise set operator.

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

Accesses indexed component of vector.

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

Accesses indexed component of vector.

SbVec2s& SbVec2s::setValue ( short  x,
short  y 
)

Sets vector components.

SbVec2s& SbVec2s::setValue ( const short  v[2]  ) 

Sets vector components.


Friends And Related Function Documentation

int operator!= ( const SbVec2s v1,
const SbVec2s v2 
) [friend]

Inequality comparison operator.

SbVec2s operator* ( double  d,
const SbVec2s v 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec2s operator* ( int  d,
const SbVec2s v 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec2s operator* ( const SbVec2s v,
double  d 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec2s operator* ( const SbVec2s v,
int  d 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec2s operator+ ( const SbVec2s v1,
const SbVec2s v2 
) [friend]

Component-wise binary vector addition operator.

SbVec2s operator- ( const SbVec2s v1,
const SbVec2s v2 
) [friend]

Component-wise binary vector subtraction operator.

SbVec2s operator/ ( const SbVec2s v,
double  d 
) [friend]

Component-wise binary scalar division operator.

SbVec2s operator/ ( const SbVec2s v,
int  d 
) [friend]

Component-wise binary scalar division operator.

std::ostream& operator<< ( std::ostream &  os,
const SbVec2s v 
) [friend]

Writes the vector to the specified output stream.

int operator== ( const SbVec2s v1,
const SbVec2s v2 
) [friend]

Equality comparison operator.


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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/