SbVec2d Class Reference

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

#include <Inventor/SbVec.h>

List of all members.

Public Member Functions

 SbVec2d ()
 SbVec2d (const double v[2])
 SbVec2d (double x, double y)
double dot (const SbVec2d &v) const
const double * getValue () const
void getValue (double &x, double &y) const
double length () const
double lengthSquared () const
void negate ()
double normalize ()
SbVec2dsetValue (const double v[2])
SbVec2dsetValue (double x, double y)
SbVec2dsetValue (const SbVec2f &vec2f)
SbVec2doperator*= (double d)
SbVec2doperator/= (double d)
SbVec2doperator+= (const SbVec2d &u)
SbVec2doperator-= (const SbVec2d &u)
SbVec2d operator- () const
SbBool equals (const SbVec2d &v, double tolerance) const
template<typename T >
 SbVec2d (const T &v)


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

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

Detailed Description

VSG extension 2D vector class (double precision).

2D vector class used to store 2D vectors and points using double precision values. 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.


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

Constructor & Destructor Documentation

SbVec2d::SbVec2d (  )  [inline]

Default constructor.

The vector is initialized with zeros.

SbVec2d::SbVec2d ( const double  v[2]  )  [inline, explicit]

Constructor given vector components.

SbVec2d::SbVec2d ( double  x,
double  y 
) [inline]

Constructor given vector components.

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

Constructor that converts an arbitrary SbVec2 to an SbVec2d.

Member Function Documentation

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

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

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

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

void SbVec2d::getValue ( double &  x,
double &  y 
) const

Returns vector components.

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

Returns vector components.

double SbVec2d::length (  )  const

Returns geometric length of vector.

double SbVec2d::lengthSquared (  )  const [inline]

Returns square length of vector.

Faster than length().

void SbVec2d::negate (  ) 

Negates each component of vector in place.

double SbVec2d::normalize (  ) 

Changes vector to be unit length.

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

Component-wise scalar multiplication operator.

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

Component-wise vector addition operator.

SbVec2d SbVec2d::operator- (  )  const

Nondestructive unary negation - returns a new vector.

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

Component-wise vector subtraction operator.

SbVec2d& SbVec2d::operator/= ( double  d  ) 

Component-wise scalar division operator.

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

Accesses indexed component of vector.

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

Accesses indexed component of vector.

SbVec2d& SbVec2d::setValue ( const SbVec2f vec2f  )  [inline]

Sets value of vector from a single precision vector.

SbVec2d& SbVec2d::setValue ( double  x,
double  y 

Sets the vector components.

SbVec2d& SbVec2d::setValue ( const double  v[2]  ) 

Sets the vector components.

Friends And Related Function Documentation

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

Inequality comparison operator.

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

Component-wise binary scalar multiplication operator.

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

Component-wise binary scalar multiplication operator.

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

Component-wise binary vector addition operator.

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

Component-wise binary vector subtraction operator.

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

Component-wise binary scalar division operator.

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

Writes the vector to the specified output stream.

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

Equality comparison operator.

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

Open Inventor Toolkit reference manual, generated on 12 Sep 2022
Copyright © Thermo Fisher Scientific All rights reserved.