Workspace 6.21.5
|
Object group defining an arbitrary 3D transformation. More...
#include <Mesh/Geometry/transformgroup.h>
Public Member Functions | |
TransformGroup () | |
TransformGroup (const TransformGroup &v) | |
TransformGroup (const TransformMatrix &matrix) | |
~TransformGroup () override | |
TransformGroup * | clone () const override |
Vector3d | getEulerAngles () const |
Vector3d | getScaleFactors () const |
Vector3d | getShear () const |
Vector3d | getTranslation () const |
TransformGroup & | operator= (const TransformGroup &v) |
TransformGroup & | operator= (const TransformMatrix &matrix) |
bool | operator== (const TransformGroup &g) const |
void | setEulerAngles (const Vector3d &angles) |
void | setScaleFactors (const Vector3d &factors) |
void | setShear (const Vector3d &shear) |
void | setTranslation (const Vector3d &trans) |
Public Member Functions inherited from ObjectGroup | |
~ObjectGroup () override | |
bool | add (const QString &name, DataObject &obj) |
bool | canSerialize () const override |
ObjectGroup * | clone () const override=0 |
bool | empty () const |
void | ensureGroupHasData () |
void | erase (int index) |
DataObject * | getChild (const QString &name) |
const DataObject * | getChild (const QString &name) const |
DataObject & | getDataObject (int index) |
const DataObject & | getDataObject (int index) const |
int | getIndex (const QString &name) const |
const QString & | getName (int index) const |
virtual QString | getPreferedWidget (const QString &name) const |
bool | hasData () const |
bool | haveName (const QString &name) const |
bool | insert (const QString &name, DataObject &obj, int index=-1) |
bool | load (const QJsonDocument &doc) |
bool | load (const SerializedItem &item) override |
bool | save (QJsonDocument &doc) const |
bool | save (SerializedItem &item) const override |
unsigned | size () const |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable ()=default |
virtual Clonable * | clone () const =0 |
Public Member Functions inherited from Serialize | |
virtual | ~Serialize ()=default |
virtual bool | canSerialize () const =0 |
virtual bool | load (const SerializedItem &item)=0 |
virtual bool | save (SerializedItem &item) const =0 |
Additional Inherited Members | |
Protected Member Functions inherited from ObjectGroup | |
ObjectGroup () | |
void | clear () |
ObjectGroup & | operator= (const ObjectGroup &rhs) |
bool | operator== (const ObjectGroup &rhs) const |
void | swap (ObjectGroup &rhs) |
There are four components to the transform: shear, scale, rotation and translation, and they are applied in that order. See the details of the TransformMatrix class for the mathematics behind how transforms are generally used.
The TransformGroup class exists to provide a more user-friendly way of defining transforms than the raw mathematical nature of TransformMatrix. TransformGroup is not meant to be computationally efficient, but rather it is best suited to operation inputs and outputs where the operations are computationally intensive or where performance is not so critical. The usual approach is to pass around TransformGroup between workspace operations and then convert it internally into a TransformMatrix for the operation itself to use in computational tasks.
TransformGroup | ( | ) |
Creates the transform as the identity matrix (ie no transform at all).
TransformGroup | ( | const TransformGroup & | v | ) |
v | The transform to copy. |
TransformGroup | ( | const TransformMatrix & | matrix | ) |
matrix | The transform matrix to be used to construct the initial values of the group. It must be invertible. |
|
override |
|
overridevirtual |
We redeclare this function only so that the more derived return type is available without casting.
Implements ObjectGroup.
Vector3d getEulerAngles | ( | ) | const |
Vector3d getScaleFactors | ( | ) | const |
Vector3d getShear | ( | ) | const |
Vector3d getTranslation | ( | ) | const |
TransformGroup & operator= | ( | const TransformGroup & | v | ) |
v | The transform to assign to this object. |
TransformGroup & operator= | ( | const TransformMatrix & | matrix | ) |
matrix | The transform matrix to be used to work out the values for the group. It must be invertible. |
bool operator== | ( | const TransformGroup & | g | ) | const |
g | The transform to compare with. |
void setEulerAngles | ( | const Vector3d & | angles | ) |
angles | The euler angles to use for the transform. Ordering is about the Z axis first, then about the Y axis and lastly about the X axis. |
All rotation occurs about the origin. If you need to rotate about some other point, you need to apply a separate transform first before rotating, then the inverse of that transform again after rotating.
void setScaleFactors | ( | const Vector3d & | factors | ) |
factors | The scale factor for each axis direction. A factor of 1 effectively indicates no scaling. Negative values imply reflection about an axis. |
All scaling occurs about the origin. If you need to scale about some other point, you need to apply a separate transform first before scaling, then the inverse of that transform again after scaling.
void setShear | ( | const Vector3d & | shear | ) |
shear | The shear coefficients. |
void setTranslation | ( | const Vector3d & | trans | ) |
trans | The translation to apply for the transform. |