SbVec4f Class Reference
[Basics]

4D vector class. More...

#include <Inventor/SbVec.h>

Inheritance diagram for SbVec4f:
SbColorRGBA

List of all members.

Public Member Functions

 SbVec4f ()
 SbVec4f (const float v[4])
 SbVec4f (float x, float y, float z, float w)
float dot (const SbVec4f &v) const
void getReal (SbVec3f &v) const
const float * getValue () const
void getValue (float &x, float &y, float &z, float &w) const
float length () const
float lengthSquared () const
void negate ()
float normalize ()
SbVec4fsetValue (const float v[4])
SbVec4fsetValue (float x, float y, float z, float w)
SbVec4fsetValue (const SbVec4d &vec4d)
SbVec4foperator*= (float d)
SbVec4foperator/= (float d)
SbVec4foperator+= (const SbVec4f &u)
SbVec4foperator-= (const SbVec4f &u)
SbVec4f operator- () const
SbBool equals (const SbVec4f &v, float tolerance) const
template<typename T >
 SbVec4f (const T &v)

Friends

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



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

Detailed Description

4D vector class.

4D vector class used to store homogeneous coordinates. This class is used in Open Inventor for arguments and return values.

SEE ALSO

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


Constructor & Destructor Documentation

SbVec4f::SbVec4f (  )  [inline]

Default constructor.

The vector is initialized with zeros.

SbVec4f::SbVec4f ( const float  v[4]  )  [inline, explicit]

Constructor given vector components.

SbVec4f::SbVec4f ( float  x,
float  y,
float  z,
float  w 
) [inline]

Constructor given vector components.

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

Constructor that converts an arbitrary SbVec4 to an SbVec4f.


Member Function Documentation

float SbVec4f::dot ( const SbVec4f v  )  const [inline]

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

SbBool SbVec4f::equals ( const SbVec4f v,
float  tolerance 
) const

Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.

void SbVec4f::getReal ( SbVec3f v  )  const

Returns the real portion of the vector by dividing by the fourth value.

void SbVec4f::getValue ( float &  x,
float &  y,
float &  z,
float &  w 
) const

Returns vector components.

const float* SbVec4f::getValue (  )  const [inline]

Returns vector components.

float SbVec4f::length (  )  const

Returns geometric length of vector.

float SbVec4f::lengthSquared (  )  const [inline]

Returns square length of vector.

Faster than length().

void SbVec4f::negate (  ) 

Negates each component of vector in place.

float SbVec4f::normalize (  ) 

Changes vector to be unit length.

SbVec4f& SbVec4f::operator*= ( float  d  ) 

Component-wise scalar multiplication operator.

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

Component-wise vector addition operator.

SbVec4f SbVec4f::operator- (  )  const

Nondestructive unary negation - returns a new vector.

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

Component-wise vector subtraction operator.

SbVec4f& SbVec4f::operator/= ( float  d  ) 

Component-wise scalar division operator.

const float& SbVec4f::operator[] ( int  i  )  const [inline]

Accesses indexed component of vector.

float& SbVec4f::operator[] ( int  i  )  [inline]

Accesses indexed component of vector.

SbVec4f& SbVec4f::setValue ( const SbVec4d vec4d  ) 

Sets value of vector from a double precision vector.

SbVec4f& SbVec4f::setValue ( float  x,
float  y,
float  z,
float  w 
)

Sets the vector components.

SbVec4f& SbVec4f::setValue ( const float  v[4]  ) 

Sets the vector components.


Friends And Related Function Documentation

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

Inequality comparison operator.

SbVec4f operator* ( float  d,
const SbVec4f v 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec4f operator* ( const SbVec4f v,
float  d 
) [friend]

Component-wise binary scalar multiplication operator.

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

Component-wise binary vector addition operator.

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

Component-wise binary vector subtraction operator.

SbVec4f operator/ ( const SbVec4f v,
float  d 
) [friend]

Component-wise binary scalar division operator.

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

Writes the vector to the specified output stream.

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

Equality comparison operator.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/