Open Inventor Reference
SbVec4d Class Reference

4D vector class with double values. More...

#include <Inventor/SbLineard.h>

Public Member Functions

 SbVec4d ()
 Default constructor.
 
 SbVec4d (const double v[4])
 Constructor given vector components.
 
 SbVec4d (double x, double y, double z, double w)
 Constructor given vector components.
 
double dot (const SbVec4d &v) const
 Returns dot (inner) product of vector and another vector.
 
void getReal (SbVec3d &v) const
 Returns the real portion of the vector by dividing by the fourth value.
 
SbVec3d getReal () const
 Returns the real portion of the vector by dividing by the fourth value.
 
const double * getValue () const
 Returns vector components.
 
void getValue (double &x, double &y, double &z, double &w) const
 Returns vector components.
 
double length () const
 Returns geometric length of vector.
 
void negate ()
 Negates each component of vector in place.
 
double normalize ()
 Changes vector to be unit length.
 
SbVec4dsetValue (const double v[4])
 Sets the vector components.
 
SbVec4dsetValue (double x, double y, double z, double w)
 Sets the vector components.
 
double & operator[] (int i)
 Accesses indexed component of vector.
 
const double & operator[] (int i) const
 
SbVec4doperator*= (double d)
 Component-wise scalar multiplication and division operators.
 
SbVec4doperator/= (double d)
 Component-wise scalar multiplication and division operators.
 
SbVec4doperator+= (const SbVec4d &u)
 Component-wise vector addition and subtraction operators.
 
SbVec4doperator-= (const SbVec4d &u)
 Component-wise vector addition and subtraction operators.
 
SbVec4d operator- () const
 Nondestructive unary negation - returns a new vector.
 
bool equals (const SbVec4d v, double tolerance) const
 Equality comparison within given tolerance em the square of the length of the maximum distance between the two vectors.
 

Protected Attributes

double vec [4]
 Storage for vector components.
 

Friends

INVENTOR_API SbVec4d operator* (const SbVec4d &v, double d)
 Component-wise binary scalar multiplication and division operators.
 
INVENTOR_API SbVec4d operator* (double d, const SbVec4d &v)
 
INVENTOR_API SbVec4d operator/ (const SbVec4d &v, double d)
 
INVENTOR_API SbVec4d operator+ (const SbVec4d &v1, const SbVec4d &v2)
 Component-wise binary vector addition and subtraction operators.
 
INVENTOR_API SbVec4d operator- (const SbVec4d &v1, const SbVec4d &v2)
 
INVENTOR_API bool operator== (const SbVec4d &v1, const SbVec4d &v2)
 Equality comparison operator.
 
INVENTOR_API bool operator!= (const SbVec4d &v1, const SbVec4d &v2)
 

Detailed Description

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

See Also
SbVec2f, SbVec3f, SbVec2d, SbVec3d, SbVec4d, SbVec2s, SbRotation

Definition at line 349 of file SbLineard.h.

Constructor & Destructor Documentation

◆ SbVec4d() [1/3]

SbVec4d::SbVec4d ( )
inline

Definition at line 353 of file SbLineard.h.

◆ SbVec4d() [2/3]

SbVec4d::SbVec4d ( const double  v[4])
inline

Definition at line 356 of file SbLineard.h.

◆ SbVec4d() [3/3]

SbVec4d::SbVec4d ( double  x,
double  y,
double  z,
double  w 
)
inline

Definition at line 359 of file SbLineard.h.

Member Function Documentation

◆ dot()

double SbVec4d::dot ( const SbVec4d v) const

◆ equals()

bool SbVec4d::equals ( const SbVec4d  v,
double  tolerance 
) const

◆ getReal() [1/2]

SbVec3d SbVec4d::getReal ( ) const
inline

Definition at line 368 of file SbLineard.h.

References getReal().

Referenced by getReal().

◆ getReal() [2/2]

void SbVec4d::getReal ( SbVec3d v) const

◆ getValue() [1/2]

const double * SbVec4d::getValue ( ) const
inline

Definition at line 371 of file SbLineard.h.

◆ getValue() [2/2]

void SbVec4d::getValue ( double &  x,
double &  y,
double &  z,
double &  w 
) const

◆ length()

double SbVec4d::length ( ) const

◆ negate()

void SbVec4d::negate ( )

◆ normalize()

double SbVec4d::normalize ( )

◆ operator*=()

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

◆ operator+=()

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

◆ operator-()

SbVec4d SbVec4d::operator- ( ) const

◆ operator-=()

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

◆ operator/=()

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

Definition at line 399 of file SbLineard.h.

◆ operator[]() [1/2]

double & SbVec4d::operator[] ( int  i)
inline

Definition at line 392 of file SbLineard.h.

◆ operator[]() [2/2]

const double & SbVec4d::operator[] ( int  i) const
inline

Definition at line 393 of file SbLineard.h.

◆ setValue() [1/2]

SbVec4d & SbVec4d::setValue ( const double  v[4])

◆ setValue() [2/2]

SbVec4d & SbVec4d::setValue ( double  x,
double  y,
double  z,
double  w 
)

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 442 of file SbLineard.h.

◆ operator* [1/2]

INVENTOR_API SbVec4d operator* ( const SbVec4d v,
double  d 
)
friend

◆ operator* [2/2]

INVENTOR_API SbVec4d operator* ( double  d,
const SbVec4d v 
)
friend

Definition at line 433 of file SbLineard.h.

◆ operator+

INVENTOR_API SbVec4d operator+ ( const SbVec4d v1,
const SbVec4d v2 
)
friend

◆ operator-

INVENTOR_API SbVec4d operator- ( const SbVec4d v1,
const SbVec4d v2 
)
friend

◆ operator/

INVENTOR_API SbVec4d operator/ ( const SbVec4d v,
double  d 
)
friend

Definition at line 435 of file SbLineard.h.

◆ operator==

INVENTOR_API bool operator== ( const SbVec4d v1,
const SbVec4d v2 
)
friend

Member Data Documentation

◆ vec

double SbVec4d::vec[4]
protected

Definition at line 429 of file SbLineard.h.


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