OpenLexocad  27.1
Base::Rotation Class Reference

#include <Rotation.h>

Public Member Functions

 Rotation ()
 
 Rotation (const Vector3d &axis, const double fAngle)
 
 Rotation (const Matrix4D &matrix)
 
 Rotation (const double q[4])
 
 Rotation (const double q0, const double q1, const double q2, const double q3)
 
 Rotation (const Vector3d &rotateFrom, const Vector3d &rotateTo)
 
 Rotation (const Rotation &rot)
 
const double * getValue (void) const
 
void getValue (double &q0, double &q1, double &q2, double &q3) const
 
void setValue (const double q0, const double q1, const double q2, const double q3)
 
void getValue (Vector3d &axis, double &rfAngle) const
 If not a null quaternion then axis will be normalized. More...
 
void getRawValue (Vector3d &axis, double &rfAngle) const
 Does the same as the method above unless normalizing the axis. More...
 
void getValue (Matrix4D &matrix) const
 
void setValue (const double q[4])
 
void setValue (const Matrix4D &matrix)
 
void setValue (const Vector3d &axis, const double fAngle)
 
void setValue (const Vector3d &rotateFrom, const Vector3d &rotateTo)
 
void setYawPitchRoll (double y, double p, double r)
 Euler angles in yaw,pitch,roll notation. More...
 
void getYawPitchRoll (double &y, double &p, double &r) const
 Euler angles in yaw,pitch,roll notation. More...
 
bool isIdentity () const
 
bool isNull () const
 
Rotationinvert (void)
 
Rotation inverse (void) const
 
Rotationoperator *= (const Rotation &q)
 
Rotation operator * (const Rotation &q) const
 
bool operator== (const Rotation &q) const
 
bool operator!= (const Rotation &q) const
 
double & operator [] (unsigned short usIndex)
 
const double & operator [] (unsigned short usIndex) const
 
void operator= (const Rotation &)
 
void multVec (const Vector3d &src, Vector3d &dst) const
 
Vector3d multVec (const Vector3d &src) const
 
void scaleAngle (const double scaleFactor)
 
bool isSame (const Rotation &) const
 
bool isSame (const Rotation &, double tol) const
 

Static Public Member Functions

static Rotation slerp (const Rotation &rot0, const Rotation &rot1, double t)
 
static Rotation identity (void)
 
static Rotation makeRotationByAxes (Vector3d xdir, Vector3d ydir, Vector3d zdir, const char *priorityOrder="ZXY")
 makeRotationByAxes(xdir, ydir, zdir, priorityOrder): creates a rotation that converts a vector in local cs with axes given as arguments, into a vector in global cs. More...
 

Constructor & Destructor Documentation

◆ Rotation() [1/7]

Base::Rotation::Rotation ( )

Construction.

◆ Rotation() [2/7]

Base::Rotation::Rotation ( const Vector3d axis,
const double  fAngle 
)

◆ Rotation() [3/7]

Base::Rotation::Rotation ( const Matrix4D matrix)

◆ Rotation() [4/7]

Base::Rotation::Rotation ( const double  q[4])

◆ Rotation() [5/7]

Base::Rotation::Rotation ( const double  q0,
const double  q1,
const double  q2,
const double  q3 
)

◆ Rotation() [6/7]

Base::Rotation::Rotation ( const Vector3d rotateFrom,
const Vector3d rotateTo 
)

◆ Rotation() [7/7]

Base::Rotation::Rotation ( const Rotation rot)

Member Function Documentation

◆ getRawValue()

void Base::Rotation::getRawValue ( Vector3d axis,
double &  rfAngle 
) const

Does the same as the method above unless normalizing the axis.

◆ getValue() [1/4]

const double* Base::Rotation::getValue ( void  ) const

Methods to get or set rotations.

◆ getValue() [2/4]

void Base::Rotation::getValue ( double &  q0,
double &  q1,
double &  q2,
double &  q3 
) const

◆ getValue() [3/4]

void Base::Rotation::getValue ( Vector3d axis,
double &  rfAngle 
) const

If not a null quaternion then axis will be normalized.

◆ getValue() [4/4]

void Base::Rotation::getValue ( Matrix4D matrix) const

◆ getYawPitchRoll()

void Base::Rotation::getYawPitchRoll ( double &  y,
double &  p,
double &  r 
) const

Euler angles in yaw,pitch,roll notation.

◆ identity()

static Rotation Base::Rotation::identity ( void  )
static

◆ inverse()

Rotation Base::Rotation::inverse ( void  ) const

◆ invert()

Rotation& Base::Rotation::invert ( void  )

Invert rotations.

◆ isIdentity()

bool Base::Rotation::isIdentity ( ) const

◆ isNull()

bool Base::Rotation::isNull ( ) const

◆ isSame() [1/2]

bool Base::Rotation::isSame ( const Rotation ) const

◆ isSame() [2/2]

bool Base::Rotation::isSame ( const Rotation ,
double  tol 
) const

◆ makeRotationByAxes()

static Rotation Base::Rotation::makeRotationByAxes ( Vector3d  xdir,
Vector3d  ydir,
Vector3d  zdir,
const char *  priorityOrder = "ZXY" 
)
static

makeRotationByAxes(xdir, ydir, zdir, priorityOrder): creates a rotation that converts a vector in local cs with axes given as arguments, into a vector in global cs.

Parameters
xdiris wanted direction of local X axis
ydir...
zdir
priorityOrdersets which directions are followed. It is a string like "ZXY". This means, Z direction is followed precisely; X direction is corrected to be perpendicular to Z direction, and used; Y direction argument is ignored altogether (Y direction is generated from Z and X).

If only one vector provided is nonzero, the other two directions are picked automatically.

◆ multVec() [1/2]

void Base::Rotation::multVec ( const Vector3d src,
Vector3d dst 
) const

◆ multVec() [2/2]

Vector3d Base::Rotation::multVec ( const Vector3d src) const

◆ operator *()

Rotation Base::Rotation::operator * ( const Rotation q) const

◆ operator *=()

Rotation& Base::Rotation::operator *= ( const Rotation q)

Operators.

◆ operator []() [1/2]

double& Base::Rotation::operator [] ( unsigned short  usIndex)
inline

◆ operator []() [2/2]

const double& Base::Rotation::operator [] ( unsigned short  usIndex) const
inline

◆ operator!=()

bool Base::Rotation::operator!= ( const Rotation q) const

◆ operator=()

void Base::Rotation::operator= ( const Rotation )

◆ operator==()

bool Base::Rotation::operator== ( const Rotation q) const

◆ scaleAngle()

void Base::Rotation::scaleAngle ( const double  scaleFactor)

◆ setValue() [1/5]

void Base::Rotation::setValue ( const double  q0,
const double  q1,
const double  q2,
const double  q3 
)

◆ setValue() [2/5]

void Base::Rotation::setValue ( const double  q[4])

◆ setValue() [3/5]

void Base::Rotation::setValue ( const Matrix4D matrix)

◆ setValue() [4/5]

void Base::Rotation::setValue ( const Vector3d axis,
const double  fAngle 
)

◆ setValue() [5/5]

void Base::Rotation::setValue ( const Vector3d rotateFrom,
const Vector3d rotateTo 
)

◆ setYawPitchRoll()

void Base::Rotation::setYawPitchRoll ( double  y,
double  p,
double  r 
)

Euler angles in yaw,pitch,roll notation.

◆ slerp()

static Rotation Base::Rotation::slerp ( const Rotation rot0,
const Rotation rot1,
double  t 
)
static

Specialty constructors


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