Blender V5.0
KDL::Vector Class Reference

A concrete implementation of a 3 dimensional vector class. More...

#include <frames.hpp>

Public Member Functions

 Vector ()
 Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
 Vector (double x, double y, double z)
 Constructs a vector out of the three values x, y and z.
 Vector (double *xyz)
 Constructs a vector out of an array of three values x, y and z.
 Vector (float *xyz)
 Constructs a vector out of an array of three values x, y and z.
 Vector (const Vector &arg)
 Assignment operator. The normal copy by value semantics.
void GetValue (double *xyz) const
 store vector components in array
Vectoroperator= (const Vector &arg)
 Assignment operator. The normal copy by value semantics.
double operator() (int index) const
 Access to elements, range checked when NDEBUG is not set, from 0..2.
double & operator() (int index)
 Access to elements, range checked when NDEBUG is not set, from 0..2.
double operator[] (int index) const
 Equivalent to double operator()(int index) const.
double & operator[] (int index)
 Equivalent to double& operator()(int index).
double x () const
double y () const
double z () const
void x (double)
void y (double)
void z (double)
void ReverseSign ()
 Reverses the sign of the Vector object itself.
Vectoroperator-= (const Vector &arg)
 subtracts a vector from the Vector object itself
Vectoroperator+= (const Vector &arg)
 Adds a vector from the Vector object itself.
Vectoroperator*= (double arg)
 Multiply by a scalar.
double Normalize (double eps=epsilon)
double Norm () const
void Set2DXY (const Vector2 &v)
 a 3D vector where the 2D vector v is put in the XY plane
void Set2DYZ (const Vector2 &v)
 a 3D vector where the 2D vector v is put in the YZ plane
void Set2DZX (const Vector2 &v)
 a 3D vector where the 2D vector v is put in the ZX plane
void Set2DPlane (const Frame &F_someframe_XY, const Vector2 &v_XY)
 a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY.

Static Public Member Functions

static Vector Zero ()

Public Attributes

double data [3]

Friends

class Rotation
class Frame
Vector operator* (const Vector &lhs, double rhs)
 Scalar multiplication is defined.
Vector operator* (double lhs, const Vector &rhs)
 Scalar multiplication is defined.
Vector operator/ (const Vector &lhs, double rhs)
 Scalar division is defined.
Vector operator+ (const Vector &lhs, const Vector &rhs)
Vector operator- (const Vector &lhs, const Vector &rhs)
Vector operator* (const Vector &lhs, const Vector &rhs)
Vector operator- (const Vector &arg)
double dot (const Vector &lhs, const Vector &rhs)
void SetToZero (Vector &v)
 To have a uniform operator to put an element to zero, for scalar values and for objects.
bool Equal (const Vector &a, const Vector &b, double eps=epsilon)
 do not use operator == because the definition of Equal(.,.) is slightly different. It compares whether the 2 arguments are equal in an eps-interval
Vector Normalize (const Vector &a, double eps=epsilon)
 return a normalized vector
bool operator== (const Vector &a, const Vector &b)
 The literal equality operator==(), also identical.
bool operator!= (const Vector &a, const Vector &b)
 The literal inequality operator!=().

Detailed Description

A concrete implementation of a 3 dimensional vector class.

Definition at line 142 of file frames.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/5]

KDL::Vector::Vector ( )
inline

Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.

Definition at line 147 of file frames.hpp.

Referenced by Normalize(), operator()(), operator*, Set2DXY(), and Zero().

◆ Vector() [2/5]

IMETHOD Vector::Vector ( double x,
double y,
double z )
inline

Constructs a vector out of the three values x, y and z.

Definition at line 37 of file frames.hpp.

◆ Vector() [3/5]

IMETHOD Vector::Vector ( double * xyz)
inline

Constructs a vector out of an array of three values x, y and z.

Definition at line 42 of file frames.hpp.

◆ Vector() [4/5]

IMETHOD Vector::Vector ( float * xyz)
inline

Constructs a vector out of an array of three values x, y and z.

Definition at line 47 of file frames.hpp.

◆ Vector() [5/5]

IMETHOD Vector::Vector ( const Vector & arg)
inline

Assignment operator. The normal copy by value semantics.

Definition at line 30 of file frames.hpp.

Member Function Documentation

◆ GetValue()

IMETHOD void Vector::GetValue ( double * xyz) const
inline

store vector components in array

Definition at line 52 of file frames.hpp.

Referenced by GetJointRotation().

◆ Norm()

double KDL::Vector::Norm ( ) const
Returns
the norm of the vector

Definition at line 115 of file frames.cpp.

References data, fabs(), sqr, and sqrt.

Referenced by convert_tree(), iTaSC::Armature::finalize(), iTaSC::Armature::getMaxEndEffectorChange(), KDL::Rotation::GetRot(), and Normalize().

◆ Normalize()

double KDL::Vector::Normalize ( double eps = epsilon)

Normalizes this vector and returns it norm makes v a unitvector and returns the norm of v. if v is smaller than eps, Vector(1,0,0) is returned with norm 0. if this is not good, check the return value of this method.

Definition at line 145 of file frames.cpp.

References eps, Norm(), v, and Vector().

Referenced by KDL::Rotation::Rot().

◆ operator()() [1/2]

double & Vector::operator() ( int index)
inline

Access to elements, range checked when NDEBUG is not set, from 0..2.

Definition at line 165 of file frames.hpp.

References Vector().

◆ operator()() [2/2]

double Vector::operator() ( int index) const
inline

Access to elements, range checked when NDEBUG is not set, from 0..2.

Definition at line 160 of file frames.hpp.

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

◆ operator*=()

Vector & Vector::operator*= ( double arg)
inline

Multiply by a scalar.

Definition at line 147 of file frames.hpp.

References data.

◆ operator+=()

Vector & Vector::operator+= ( const Vector & arg)
inline

Adds a vector from the Vector object itself.

Definition at line 129 of file frames.hpp.

References Frame, and Rotation.

◆ operator-=()

Vector & Vector::operator-= ( const Vector & arg)
inline

subtracts a vector from the Vector object itself

Definition at line 138 of file frames.hpp.

◆ operator=()

IMETHOD Vector & Vector::operator= ( const Vector & arg)
inline

Assignment operator. The normal copy by value semantics.

Definition at line 58 of file frames.hpp.

◆ operator[]() [1/2]

double & KDL::Vector::operator[] ( int index)
inline

Equivalent to double& operator()(int index).

Definition at line 180 of file frames.hpp.

References operator()().

◆ operator[]() [2/2]

double KDL::Vector::operator[] ( int index) const
inline

Equivalent to double operator()(int index) const.

Definition at line 174 of file frames.hpp.

References operator()().

◆ ReverseSign()

void Vector::ReverseSign ( )
inline

Reverses the sign of the Vector object itself.

Definition at line 450 of file frames.hpp.

◆ Set2DPlane()

void Vector::Set2DPlane ( const Frame & F_someframe_XY,
const Vector2 & v_XY )
inline

a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY.

Definition at line 741 of file frames.hpp.

References b.

◆ Set2DXY()

void Vector::Set2DXY ( const Vector2 & v)
inline

a 3D vector where the 2D vector v is put in the XY plane

Definition at line 468 of file frames.hpp.

References data, and Vector().

◆ Set2DYZ()

void Vector::Set2DYZ ( const Vector2 & v)
inline

a 3D vector where the 2D vector v is put in the YZ plane

Definition at line 476 of file frames.hpp.

◆ Set2DZX()

void Vector::Set2DZX ( const Vector2 & v)
inline

a 3D vector where the 2D vector v is put in the ZX plane

Definition at line 485 of file frames.hpp.

References data.

◆ x() [1/2]

IMETHOD double Vector::x ( ) const
inline

Definition at line 84 of file frames.hpp.

◆ x() [2/2]

IMETHOD void Vector::x ( double _x)
inline

Definition at line 88 of file frames.hpp.

◆ y() [1/2]

IMETHOD double Vector::y ( ) const
inline

Definition at line 85 of file frames.hpp.

◆ y() [2/2]

IMETHOD void Vector::y ( double _y)
inline

Definition at line 89 of file frames.hpp.

◆ z() [1/2]

IMETHOD double Vector::z ( ) const
inline

Definition at line 86 of file frames.hpp.

◆ z() [2/2]

IMETHOD void Vector::z ( double _z)
inline

Definition at line 90 of file frames.hpp.

◆ Zero()

Vector Vector::Zero ( )
inlinestatic
Returns
a zero vector

Definition at line 155 of file frames.hpp.

References Vector().

Referenced by KDL::operator>>().

◆ dot

double dot ( const Vector & lhs,
const Vector & rhs )
friend

Definition at line 1049 of file frames.hpp.

References i.

◆ Equal

bool Equal ( const Vector & a,
const Vector & b,
double eps = epsilon )
friend

do not use operator == because the definition of Equal(.,.) is slightly different. It compares whether the 2 arguments are equal in an eps-interval

Definition at line 1069 of file frames.hpp.

References b, and eps.

◆ Frame

friend class Frame
friend

Definition at line 261 of file frames.hpp.

References Frame.

Referenced by Frame, and operator+=().

◆ Normalize

Vector Normalize ( const Vector & a,
double eps = epsilon )
friend

return a normalized vector

Definition at line 171 of file frames.hpp.

◆ operator!=

bool operator!= ( const Vector & a,
const Vector & b )
friend

The literal inequality operator!=().

Definition at line 1367 of file frames.hpp.

◆ operator* [1/3]

Vector operator* ( const Vector & lhs,
const Vector & rhs )
friend

Definition at line 119 of file frames.hpp.

References Vector().

◆ operator* [2/3]

Vector operator* ( const Vector & lhs,
double rhs )
friend

Scalar multiplication is defined.

Definition at line 92 of file frames.hpp.

◆ operator* [3/3]

Vector operator* ( double lhs,
const Vector & rhs )
friend

Scalar multiplication is defined.

Definition at line 101 of file frames.hpp.

◆ operator+

Vector operator+ ( const Vector & lhs,
const Vector & rhs )
friend

Definition at line 66 of file frames.hpp.

◆ operator- [1/2]

Vector operator- ( const Vector & arg)
friend

Definition at line 459 of file frames.hpp.

◆ operator- [2/2]

Vector operator- ( const Vector & lhs,
const Vector & rhs )
friend

Definition at line 75 of file frames.hpp.

◆ operator/

Vector operator/ ( const Vector & lhs,
double rhs )
friend

Scalar division is defined.

Definition at line 110 of file frames.hpp.

◆ operator==

bool operator== ( const Vector & a,
const Vector & b )
friend

The literal equality operator==(), also identical.

Definition at line 1357 of file frames.hpp.

◆ Rotation

friend class Rotation
friend

Definition at line 260 of file frames.hpp.

References Rotation.

Referenced by operator+=(), and Rotation.

◆ SetToZero

void SetToZero ( Vector & v)
friend

To have a uniform operator to put an element to zero, for scalar values and for objects.

Definition at line 1105 of file frames.hpp.

Member Data Documentation

◆ data

double KDL::Vector::data[3]

Definition at line 145 of file frames.hpp.

Referenced by KDL::Rotation::GetRot(), Norm(), operator*=(), Set2DXY(), and Set2DZX().


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