SbVec3d Class Reference
[Basics]

VSG extension 3D vector class (double precision). More...

#include <Inventor/SbVec.h>

List of all members.

Public Member Functions

 SbVec3d ()
 SbVec3d (const double v[3])
 SbVec3d (double x, double y, double z)
 SbVec3d (SbPlane &p0, SbPlane &p1, SbPlane &p2)
SbVec3d cross (const SbVec3d &v) const
double dot (const SbVec3d &v) const
const double * getValue () const
void getValue (double &x, double &y, double &z) const
double length () const
double lengthSquared () const
double normalize ()
void negate ()
SbVec3dsetValue (const double v[3])
SbVec3dsetValue (double x, double y, double z)
SbVec3dsetValue (const SbVec3d &barycentic, const SbVec3d &v0, const SbVec3d &v1, const SbVec3d &v2)
SbVec3dsetValue (const SbVec3f &vec3f)
SbVec3doperator*= (double d)
SbVec3doperator/= (double d)
SbVec3doperator+= (const SbVec3d &v)
SbVec3doperator-= (const SbVec3d &v)
SbVec3d operator- () const
SbVec3d operator* (const SbVec3d &v) const
SbVec3doperator*= (const SbVec3d &v)
SbBool equals (const SbVec3d &v, double tolerance) const
SbVec3d getClosestAxis () const
template<typename T >
 SbVec3d (const T &v)

Friends

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



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

Detailed Description

VSG extension 3D vector class (double precision).

3D vector class used to store 3D vectors and points. Although Open Inventor fields still store only single precision values, for certain applications it is useful and convenient to be able to store and manipulate double precision values, for example, double precision coordinate data or values that will be used for further computation.

SEE ALSO

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


Constructor & Destructor Documentation

SbVec3d::SbVec3d (  )  [inline]

Default constructor.

The vector is not initialized.

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

Constructor given vector components.

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

Constructor given vector components.

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

Constructor given 3 planes.

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

Constructor that converts an arbitrary SbVec3 to an SbVec3d.


Member Function Documentation

SbVec3d SbVec3d::cross ( const SbVec3d v  )  const [inline]

Returns right-handed cross product of vector and another vector.

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

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

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

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

SbVec3d SbVec3d::getClosestAxis (  )  const

Returns principal axis that is closest (based on maximum dot product) to this vector.

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

Returns vector components.

const double* SbVec3d::getValue (  )  const [inline]

Returns vector components.

double SbVec3d::length (  )  const

Returns geometric length of vector.

double SbVec3d::lengthSquared (  )  const [inline]

Returns square length of vector.

Faster than length().

void SbVec3d::negate (  ) 

Negates each component of vector in place.

double SbVec3d::normalize (  ) 

Changes vector to be unit length, returning the length before normalization.

SbVec3d SbVec3d::operator* ( const SbVec3d v  )  const [inline]

Component-wise vector multiplication operator.

SbVec3d& SbVec3d::operator*= ( const SbVec3d v  )  [inline]

Component-wise vector multiplication operator.

SbVec3d& SbVec3d::operator*= ( double  d  )  [inline]

Component-wise scalar multiplication operator.

SbVec3d& SbVec3d::operator+= ( const SbVec3d v  )  [inline]

Component-wise vector addition operator.

SbVec3d SbVec3d::operator- (  )  const [inline]

Nondestructive unary negation - returns a new vector.

SbVec3d& SbVec3d::operator-= ( const SbVec3d v  )  [inline]

Component-wise vector subtraction operator.

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

Component-wise scalar division operator.

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

Accesses indexed component of vector.

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

Accesses indexed component of vector.

SbVec3d& SbVec3d::setValue ( const SbVec3f vec3f  )  [inline]

Sets value of vector from a single precision vector.

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

Sets value of vector as the weighted average of 3 other vectors.

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

Sets the vector components.

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

Sets the vector components.


Friends And Related Function Documentation

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

Inequality comparison operator.

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

Component-wise binary scalar multiplication operator.

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

Component-wise binary scalar multiplication operator.

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

Component-wise binary vector addition operator.

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

Component-wise binary vector subtraction operator.

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

Component-wise binary scalar division operator.

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

Writes the vector to the specified output stream.

int operator== ( const SbVec3d v1,
const SbVec3d 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/