KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Class for applying affine transformations. More...
#include <affine_transform.h>
Public Member Functions | |
Type Definitions | |
KRATOS_CLASS_POINTER_DEFINITION (AffineTransform) | |
Life Cycle | |
AffineTransform () | |
Default constructor sets up an identity transform. More... | |
AffineTransform (const array_1d< double, 3 > &rAxis, const double angle, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector) | |
Construct from axis and angle. More... | |
AffineTransform (const array_1d< double, 3 > &rEulerAngles, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector) | |
Construct from euler angles. More... | |
AffineTransform (const Quaternion< double > &rQuaternion, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector) | |
Construct from a quaternion. More... | |
Operations | |
void | SetRotation (const array_1d< double, 3 > &rAxis, const double angle, const array_1d< double, 3 > &rReferencePoint) |
Set rotation from an axis and an angle. More... | |
void | SetRotation (const array_1d< double, 3 > &rEulerAngles, const array_1d< double, 3 > &rReferencePoint) |
Set rotation from euler angles. More... | |
void | SetRotation (const Quaternion< double > &rQuaternion, const array_1d< double, 3 > &rReferencePoint) |
Set rotation from a quaternion. More... | |
void | SetTranslation (const array_1d< double, 3 > &rTranslationVector) |
Set translation part of the transformation. More... | |
array_1d< double, 3 > | Apply (const array_1d< double, 3 > &rPoint) const |
Return the transformed version of the input vector. More... | |
Protected Attributes | |
Member Variables | |
array_1d< double, 3 > | mReferencePoint |
array_1d< double, 3 > | mTranslationVector |
Matrix | mRotationMatrix |
Class for applying affine transformations.
for now, only a rotation followed by a translation on an array of size 3 is implemented. The net transformation is equivalent to: 1) Translation to the reference frame (offset the origin) 2) Specified rotation 3) Reverse translation from the reference frame (undo origin offset) 4) Specified translation
Kratos::AffineTransform::AffineTransform | ( | ) |
Default constructor sets up an identity transform.
Kratos::AffineTransform::AffineTransform | ( | const array_1d< double, 3 > & | rAxis, |
const double | angle, | ||
const array_1d< double, 3 > & | rReferencePoint, | ||
const array_1d< double, 3 > & | rTranslationVector | ||
) |
Construct from axis and angle.
rAxis | axis of rotation (direction vector). |
angle | angle of rotation (in radians). |
rReferencePoint | a point on the axis of rotation. |
rTranslationVector | translation vector. |
Kratos::AffineTransform::AffineTransform | ( | const array_1d< double, 3 > & | rEulerAngles, |
const array_1d< double, 3 > & | rReferencePoint, | ||
const array_1d< double, 3 > & | rTranslationVector | ||
) |
Construct from euler angles.
rEulerAngles | euler angles (radians). |
rReferencePoint | origin of rotation. |
rTranslationVector | translation vector. |
Kratos::AffineTransform::AffineTransform | ( | const Quaternion< double > & | rQuaternion, |
const array_1d< double, 3 > & | rReferencePoint, | ||
const array_1d< double, 3 > & | rTranslationVector | ||
) |
Construct from a quaternion.
rQuaternion | quaternion defining the rotation angle and axis. |
rReferencePoint | a point on the axis of rotation. |
rTranslationVector | translation vector. |
|
inline |
Return the transformed version of the input vector.
Kratos::AffineTransform::KRATOS_CLASS_POINTER_DEFINITION | ( | AffineTransform | ) |
void Kratos::AffineTransform::SetRotation | ( | const array_1d< double, 3 > & | rAxis, |
const double | angle, | ||
const array_1d< double, 3 > & | rReferencePoint | ||
) |
Set rotation from an axis and an angle.
rAxis | axis of rotation. |
angle | angle of rotation (radians). |
rReferencePoint | a point on the axis of rotation. |
void Kratos::AffineTransform::SetRotation | ( | const array_1d< double, 3 > & | rEulerAngles, |
const array_1d< double, 3 > & | rReferencePoint | ||
) |
Set rotation from euler angles.
rEulerAngles | euler angles (radians). |
rReferencePoint | a point on the axis of rotation. |
void Kratos::AffineTransform::SetRotation | ( | const Quaternion< double > & | rQuaternion, |
const array_1d< double, 3 > & | rReferencePoint | ||
) |
Set rotation from a quaternion.
rQuaternion | quaternion defining the axis and angle of rotation. |
rReferencePoint | a point on the axis of rotation. |
Set translation part of the transformation.
rTranslationVector | translation vector. |
|
protected |