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

◆ SbVec4d() [2/3]

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

Definition at line 356 of file SbLineard.h.

References setValue().

◆ SbVec4d() [3/3]

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

Definition at line 359 of file SbLineard.h.

References setValue().

Member Function Documentation

◆ dot()

double SbVec4d::dot ( const SbVec4d & v) const

References SbVec4d().

◆ equals()

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

References SbVec4d().

◆ 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.

References vec.

◆ 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)

References SbVec4d().

◆ operator+=()

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

References SbVec4d().

◆ operator-()

SbVec4d SbVec4d::operator- ( ) const

References SbVec4d().

◆ operator-=()

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

References SbVec4d().

◆ operator/=()

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

Definition at line 399 of file SbLineard.h.

References SbVec4d().

◆ operator[]() [1/2]

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

Definition at line 392 of file SbLineard.h.

References vec.

◆ operator[]() [2/2]

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

Definition at line 393 of file SbLineard.h.

References vec.

◆ setValue() [1/2]

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

References SbVec4d().

Referenced by SbVec4d(), and SbVec4d().

◆ setValue() [2/2]

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

References SbVec4d().

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.

References INVENTOR_API, and SbVec4d().

◆ operator* [1/2]

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

References INVENTOR_API, and SbVec4d().

◆ operator* [2/2]

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

Definition at line 433 of file SbLineard.h.

References INVENTOR_API, and SbVec4d().

◆ operator+

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

References INVENTOR_API, and SbVec4d().

◆ operator-

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

References INVENTOR_API, and SbVec4d().

◆ operator/

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

Definition at line 435 of file SbLineard.h.

References INVENTOR_API, and SbVec4d().

◆ operator==

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

References INVENTOR_API, and SbVec4d().

Member Data Documentation

◆ vec

double SbVec4d::vec[4]
protected

Definition at line 429 of file SbLineard.h.

Referenced by getValue(), operator[](), operator[](), and SbVec4d().


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