#include <Rotation.h>
Public Types | |
enum | EulerSequence { Invalid , EulerAngles , YawPitchRoll , Extrinsic_XYZ , Extrinsic_XZY , Extrinsic_YZX , Extrinsic_YXZ , Extrinsic_ZXY , Extrinsic_ZYX , Intrinsic_XYZ , Intrinsic_XZY , Intrinsic_YZX , Intrinsic_YXZ , Intrinsic_ZXY , Intrinsic_ZYX , Extrinsic_XYX , Extrinsic_XZX , Extrinsic_YZY , Extrinsic_YXY , Extrinsic_ZYZ , Extrinsic_ZXZ , Intrinsic_XYX , Intrinsic_XZX , Intrinsic_YZY , Intrinsic_YXY , Intrinsic_ZXZ , Intrinsic_ZYZ , EulerSequenceLast } |
Public Member Functions | |
void | getEulerAngles (EulerSequence seq, double &alpha, double &beta, double &gamma) const |
void | getRawValue (Vector3d &axis, double &rfAngle) const |
Does the same as the method above unless normalizing the axis. More... | |
const double * | getValue () const |
Methods to get or set rotations. More... | |
void | getValue (double &q0, double &q1, double &q2, double &q3) const |
void | getValue (Matrix4D &matrix) const |
Returns this rotation in form of a matrix. More... | |
void | getValue (Vector3d &axis, double &rfAngle) const |
If not a null quaternion then axis will be normalized. More... | |
void | getYawPitchRoll (double &y, double &p, double &r) const |
Euler angles in yaw,pitch,roll notation. More... | |
Rotation | inverse () const |
Rotation & | invert () |
Invert rotations. More... | |
bool | isIdentity () const |
bool | isNull () const |
bool | isSame (const Rotation &) const |
bool | isSame (const Rotation &, double tol) const |
Vector3d | multVec (const Vector3d &src) const |
void | multVec (const Vector3d &src, Vector3d &dst) const |
bool | operator!= (const Rotation &q) const |
Rotation | operator* (const Rotation &q) const |
Rotation & | operator*= (const Rotation &q) |
Operators. More... | |
void | operator= (const Rotation &) |
bool | operator== (const Rotation &q) const |
double & | operator[] (unsigned short usIndex) |
const double & | operator[] (unsigned short usIndex) const |
Rotation () | |
Construction. More... | |
Rotation (const double q0, const double q1, const double q2, const double q3) | |
Construct a rotation initialized with the given quaternion components: q0 = x, q1 = y, q2 = z and q3 = w, where the quaternion is specified by q=w+xi+yj+zk. More... | |
Rotation (const double q[4]) | |
Construct a rotation initialized with the given quaternion components: q[0] = x, q[1] = y, q[2] = z and q[3] = w, where the quaternion is specified by q=w+xi+yj+zk. More... | |
Rotation (const Matrix4D &matrix) | |
Rotation (const Rotation &rot) | |
Rotation (const Vector3d &axis, const double fAngle) | |
Construct a rotation by rotation axis and angle. More... | |
Rotation (const Vector3d &rotateFrom, const Vector3d &rotateTo) | |
void | scaleAngle (const double scaleFactor) |
void | setEulerAngles (EulerSequence seq, double alpha, double beta, double gamma) |
void | setValue (const double q0, const double q1, const double q2, const double q3) |
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... | |
Static Public Member Functions | |
static EulerSequence | eulerSequenceFromName (const char *name) |
static const char * | eulerSequenceName (EulerSequence seq) |
static Rotation | identity () |
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... | |
static Rotation | slerp (const Rotation &rot0, const Rotation &rot1, double t) |
Specialty constructors. More... | |
Rotation::Rotation | ( | ) |
Construction.
Referenced by identity(), makeRotationByAxes(), and slerp().
Rotation::Rotation | ( | const Vector3d & | axis, |
const double | fAngle | ||
) |
Construct a rotation by rotation axis and angle.
References setValue().
Rotation::Rotation | ( | const Matrix4D & | matrix | ) |
References setValue().
Rotation::Rotation | ( | const double | q[4] | ) |
Construct a rotation initialized with the given quaternion components: q[0] = x, q[1] = y, q[2] = z and q[3] = w, where the quaternion is specified by q=w+xi+yj+zk.
References setValue().
Rotation::Rotation | ( | const double | q0, |
const double | q1, | ||
const double | q2, | ||
const double | q3 | ||
) |
Construct a rotation initialized with the given quaternion components: q0 = x, q1 = y, q2 = z and q3 = w, where the quaternion is specified by q=w+xi+yj+zk.
References setValue().
References setValue().
Rotation::Rotation | ( | const Rotation & | rot | ) |
|
static |
References Invalid.
|
static |
References EulerSequenceLast, and Invalid.
void Rotation::getEulerAngles | ( | EulerSequence | seq, |
double & | alpha, | ||
double & | beta, | ||
double & | gamma | ||
) | const |
References getValue().
void Rotation::getRawValue | ( | Vector3d & | axis, |
double & | rfAngle | ||
) | const |
Does the same as the method above unless normalizing the axis.
References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
const double * Rotation::getValue | ( | ) | const |
Methods to get or set rotations.
Referenced by Data::ComplexGeoData::applyRotation(), Import::ExportOCAF::createNode(), Part::Tools::fromPlacement(), getEulerAngles(), Part::Feature::getLocation(), Part::FeatureReference::getLocation(), operator*=(), Path::Toolpath::recalculate(), Part::Geometry::rotate(), Import::ExportOCAF::saveShape(), scaleAngle(), Gui::PropertyEditor::RotationHelper::setAxis(), Gui::View3DInventorPy::setCameraOrientation(), Part::TopoShape::setShapePlacement(), Gui::ViewProviderInventorObject::updateData(), Gui::ViewProviderVRMLObject::updateData(), Gui::ViewProviderDragger::updateTransform(), and Gui::View3DInventorPy::viewPosition().
void Rotation::getValue | ( | double & | q0, |
double & | q1, | ||
double & | q2, | ||
double & | q3 | ||
) | const |
void Rotation::getValue | ( | Matrix4D & | matrix | ) | const |
Returns this rotation in form of a matrix.
void Rotation::getValue | ( | Vector3d & | axis, |
double & | rfAngle | ||
) | const |
If not a null quaternion then axis will be normalized.
References Base::Vector3< _Precision >::Normalize(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void Rotation::getYawPitchRoll | ( | double & | y, |
double & | p, | ||
double & | r | ||
) | const |
Euler angles in yaw,pitch,roll notation.
Referenced by PartGui::TaskDlgAttacher::accept(), Path::Command::setFromPlacement(), Path::Command::transform(), and RobotGui::TaskTrajectoryDressUpParameter::viewPlacement().
|
static |
References Rotation().
Rotation Rotation::inverse | ( | ) | const |
Rotation & Rotation::invert | ( | ) |
Invert rotations.
Referenced by PathScripts.PathDressupLeadInOut.ObjectDressup::getLeadEnd(), and PathScripts.PathDressupLeadInOut.ObjectDressup::getLeadStart().
bool Rotation::isIdentity | ( | ) | const |
bool Rotation::isNull | ( | ) | const |
|
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.
xdir | is wanted direction of local X axis |
ydir | ... |
zdir | |
priorityOrder | sets 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.
References Base::Vector3< _Precision >::Cross(), Base::Vector3< _Precision >::Length(), Base::Vector3< _Precision >::Normalize(), Rotation(), Base::Matrix4D::setToUnity(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by Attacher::AttachEngine3D::calculateAttachedPlacement().
Referenced by ReenGui::FitBSplineSurfaceWidget::accept(), Attacher::AttachEngine3D::calculateAttachedPlacement(), Part::Extrusion::calculateShapeNormal(), Path::compensateRotation(), Base::CoordinateSystem::displacement(), PartDesignGui::fixSketchSupport(), PartDesign::ProfileBased::getAxis(), PartDesign::Line::getDirection(), PartDesign::Plane::getNormal(), PartDesign::ProfileBased::getProfileNormal(), PartDesign::ProfileBased::getReversedAngle(), PartDesign::LinearPattern::getTransformations(), PartDesign::Mirrored::getTransformations(), PartDesign::PolarPattern::getTransformations(), PartDesign::CoordinateSystem::getXAxis(), PartDesign::CoordinateSystem::getYAxis(), PartDesign::CoordinateSystem::getZAxis(), Sketcher::SketchObject::isCarbonCopyAllowed(), PartDesign::Feature::makePlnFromPlane(), multVec(), Attacher::AttachEngine::placementFactory(), Attacher::AttachEngine::readLinks(), Sketcher::SketchObject::rebuildExternalGeometry(), TechDraw::DrawViewSection::sectionLineEnds(), Gui::View3DInventorViewer::toggleClippingPlane(), Gui::ManualAlignment::Private::transformation2x2(), Gui::ManualAlignment::Private::transformation3x3(), Path::PathSegmentWalker::walk(), Points::PlyWriter::write(), and Points::PcdWriter::write().
Operators.
References getValue(), and setValue().
void Rotation::operator= | ( | const Rotation & | rot | ) |
double & Base::Rotation::operator[] | ( | unsigned short | usIndex | ) |
const double & Base::Rotation::operator[] | ( | unsigned short | usIndex | ) | const |
void Rotation::scaleAngle | ( | const double | scaleFactor | ) |
References getValue(), and setValue().
void Rotation::setEulerAngles | ( | EulerSequence | seq, |
double | alpha, | ||
double | beta, | ||
double | gamma | ||
) |
References EulerSequenceLast, and Invalid.
void Rotation::setValue | ( | const double | q0, |
const double | q1, | ||
const double | q2, | ||
const double | q3 | ||
) |
void Rotation::setValue | ( | const double | q[4] | ) |
void Rotation::setValue | ( | const Matrix4D & | matrix | ) |
void Rotation::setValue | ( | const Vector3d & | axis, |
const double | fAngle | ||
) |
void Rotation::setYawPitchRoll | ( | double | y, |
double | p, | ||
double | r | ||
) |
Euler angles in yaw,pitch,roll notation.
References setValue().
Referenced by Path::Command::getPlacement(), and Path::yawPitchRoll().
Specialty constructors.
References Base::Vector3< double >::epsilon(), DraftVecUtils::neg(), and Rotation().
Referenced by Base::Placement::slerp().