Open Inventor Reference
SbVec3d Class Reference

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

#include <Inventor/SbLineard.h>

Public Member Functions

 SbVec3d ()
 Default constructor.
 
 SbVec3d (const double v[3])
 Constructor given vector components.
 
 SbVec3d (double x, double y, double z)
 Constructor given vector components.
 
 SbVec3d (SbPlaned &p0, SbPlaned &p1, SbPlaned &p2)
 Constructor given 3 planes.
 
SbVec3d cross (const SbVec3d &v) const
 Returns right-handed cross product of vector and another vector.
 
double dot (const SbVec3d &v) const
 Returns dot (inner) product of vector and another vector.
 
const double * getValue () const
 Returns vector components.
 
void getValue (double &x, double &y, double &z) const
 Returns vector components.
 
double length () const
 Returns geometric length of vector.
 
double normalize ()
 Changes vector to be unit length, returning the length before normalization.
 
void negate ()
 Negates each component of vector in place.
 
SbVec3dsetValue (const double v[3])
 Sets the vector components.
 
SbVec3dsetValue (double x, double y, double z)
 Sets the vector components.
 
SbVec3dsetValue (const SbVec3d &barycentic, const SbVec3d &v0, const SbVec3d &v1, const SbVec3d &v2)
 Sets value of vector to be convex combination of 3 other vectors, using barycentic coordinates.
 
double & operator[] (int i)
 Accesses indexed component of vector.
 
const double & operator[] (int i) const
 
SbVec3doperator*= (double d)
 Component-wise scalar multiplication and division operators.
 
SbVec3doperator/= (double d)
 Component-wise scalar multiplication and division operators.
 
SbVec3doperator+= (SbVec3d v)
 Component-wise vector addition and subtraction operators.
 
SbVec3doperator-= (SbVec3d v)
 Component-wise vector addition and subtraction operators.
 
SbVec3d operator- () const
 Nondestructive unary negation - returns a new vector.
 
bool equals (const SbVec3d v, double tolerance) const
 Equality comparison within given tolerance em the square of the length of the maximum distance between the two vectors.
 
SbVec3d getClosestAxis () const
 Returns principal axis that is closest (based on maximum dot product) to this vector.
 

Protected Attributes

double vec [3]
 Storage for vector components.
 

Friends

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

Detailed Description

3D vector class used to store 3D vectors and points. This class is used throughout Inventor for arguments and return values. {}

See Also
SbVec2f, SbVec3f, SbVec4f, SbVec2d, SbVec4d, SbVec2s, SbRotation, SbRotationd

Definition at line 116 of file SbLineard.h.

Constructor & Destructor Documentation

◆ SbVec3d() [1/4]

SbVec3d::SbVec3d ( )
inline

Definition at line 120 of file SbLineard.h.

◆ SbVec3d() [2/4]

SbVec3d::SbVec3d ( const double  v[3])
inline

Definition at line 123 of file SbLineard.h.

◆ SbVec3d() [3/4]

SbVec3d::SbVec3d ( double  x,
double  y,
double  z 
)
inline

Definition at line 127 of file SbLineard.h.

◆ SbVec3d() [4/4]

SbVec3d::SbVec3d ( SbPlaned p0,
SbPlaned p1,
SbPlaned p2 
)

Member Function Documentation

◆ cross()

SbVec3d SbVec3d::cross ( const SbVec3d v) const

◆ dot()

double SbVec3d::dot ( const SbVec3d v) const

◆ equals()

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

◆ getClosestAxis()

SbVec3d SbVec3d::getClosestAxis ( ) const

◆ getValue() [1/2]

const double * SbVec3d::getValue ( ) const
inline

Definition at line 140 of file SbLineard.h.

◆ getValue() [2/2]

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

◆ length()

double SbVec3d::length ( ) const

◆ negate()

void SbVec3d::negate ( )

◆ normalize()

double SbVec3d::normalize ( )

◆ operator*=()

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

◆ operator+=()

SbVec3d & SbVec3d::operator+= ( SbVec3d  v)

◆ operator-()

SbVec3d SbVec3d::operator- ( ) const

◆ operator-=()

SbVec3d & SbVec3d::operator-= ( SbVec3d  v)

◆ operator/=()

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

Definition at line 175 of file SbLineard.h.

◆ operator[]() [1/2]

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

Definition at line 168 of file SbLineard.h.

◆ operator[]() [2/2]

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

Definition at line 169 of file SbLineard.h.

◆ setValue() [1/3]

SbVec3d & SbVec3d::setValue ( const double  v[3])
inline

Definition at line 155 of file SbLineard.h.

◆ setValue() [2/3]

SbVec3d & SbVec3d::setValue ( const SbVec3d barycentic,
const SbVec3d v0,
const SbVec3d v1,
const SbVec3d v2 
)

◆ setValue() [3/3]

SbVec3d & SbVec3d::setValue ( double  x,
double  y,
double  z 
)
inline

Definition at line 159 of file SbLineard.h.

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 222 of file SbLineard.h.

◆ operator* [1/2]

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

◆ operator* [2/2]

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

Definition at line 213 of file SbLineard.h.

◆ operator+

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

◆ operator-

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

◆ operator/

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

Definition at line 215 of file SbLineard.h.

◆ operator==

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

Member Data Documentation

◆ vec

double SbVec3d::vec[3]
protected

Definition at line 209 of file SbLineard.h.


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