diff options
author | Tomi Korpipää <tomi.korpipaa@theqtcompany.com> | 2016-04-20 14:25:09 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@theqtcompany.com> | 2016-04-21 09:33:12 +0000 |
commit | 5e93098f1d1095f004ddf0e836d05f6f253deb14 (patch) | |
tree | 80262a449429d56d8e7a5d3e0aea01832ef5db83 /src/core/transforms/qtransform.cpp | |
parent | 719e0c203d5e502e1ba2cf54da9ac3ee78f9d6f2 (diff) |
Added the rest of Qt3DCore doc skeletons
Change-Id: I6898bdc24821276d44fdf5f42170143b7a0cbfd9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Reviewed-by: Pasi Keränen <pasi.keranen@theqtcompany.com>
Reviewed-by: Antti Määttä <antti.maatta@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/transforms/qtransform.cpp')
-rw-r--r-- | src/core/transforms/qtransform.cpp | 198 |
1 files changed, 191 insertions, 7 deletions
diff --git a/src/core/transforms/qtransform.cpp b/src/core/transforms/qtransform.cpp index 10c66aeed..e03108397 100644 --- a/src/core/transforms/qtransform.cpp +++ b/src/core/transforms/qtransform.cpp @@ -57,18 +57,130 @@ QTransformPrivate::QTransformPrivate() { } +/*! + * \qmltype Transform + * \inqmlmodule Qt3D.Core + * \inherits Component3D + * \instantiates Qt3DCore::QComponent + * \since 5.6 + * + * TODO + */ + +/*! + * \qmlproperty matrix4x4 Transform::matrix + * + * Holds the matrix4x4 of the transform. + */ + +/*! + * \qmlproperty real Transform::rotationX + * + * Holds the x rotation of the transform as Euler angle. + */ + +/*! + * \qmlproperty real Transform::rotationY + * + * Holds the y rotation of the transform as Euler angle. + */ + +/*! + * \qmlproperty real Transform::rotationZ + * + * Holds the z rotation of the transform as Euler angle. + */ + +/*! + * \qmlproperty vector3d Transform::scale3D + * + * Holds the scale of the transform as vector3d. + */ + +/*! + * \qmlproperty float Transform::scale + * + * Holds the uniform scale of the transform. If the scale has been set with scale3D, holds + * the x value only. + */ + +/*! + * \qmlproperty quaternion Transform::rotation + * + * Holds the rotation of the transform as quaternion. + */ + +/*! + * \qmlproperty vector3d Transform::translation + * + * Holds the translation of the transform as vector3d. + */ + +/*! + * \qmlmethod quaternion Transform::fromAxisAndAngle(vector3d axis, real angle) + * Creates a quaternion from \a axis and \a angle. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod quaternion Transform::fromAxisAndAngle(real x, real y, real z, real angle) + * Creates a quaternion from \a x, \a y, \a z, and \a angle. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod quaternion Transform::fromAxesAndAngles(vector3d axis1, real angle1, + * vector3d axis2, real angle2) + * Creates a quaternion from \a axis1, \a angle1, \a axis2, and \a angle2. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod quaternion Transform::fromAxesAndAngles(vector3d axis1, real angle1, + * vector3d axis2, real angle2, + * vector3d axis3, real angle3) + * Creates a quaternion from \a axis1, \a angle1, \a axis2, \a angle2, \a axis3, and \a angle3. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod quaternion Transform::fromEulerAngles(vector3d eulerAngles) + * Creates a quaternion from \a eulerAngles. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod quaternion Transform::fromEulerAngles(real pitch, real yaw, real roll) + * Creates a quaternion from \a pitch, \a yaw, and \a roll. + * \return the resulting quaternion. + */ + +/*! + * \qmlmethod matrix4x4 Transform::rotateAround(vector3d point, real angle, vector3d axis) + * Creates a rotation matrix from \a axis and \a angle around \a point. + * \return the resulting matrix4x4. + */ + +/*! + * \class Qt3DCore::QTransform + * \inmodule Qt3DCore + * \inherits Qt3DCore::QComponent + * \since 5.6 + * + * TODO + */ + +/*! + * Constructs a new QTransform with \a parent. + */ QTransform::QTransform(QNode *parent) : QComponent(*new QTransformPrivate, parent) { } -/*! - \qmltype Transform - \inqmlmodule Qt3D.Core - \since 5.6 - \TODO -*/ -/*! \internal */ +/*! + * \internal + */ QTransform::QTransform(QTransformPrivate &dd, QNode *parent) : QComponent(dd, parent) { @@ -79,6 +191,9 @@ QTransform::~QTransform() QNode::cleanup(); } +/*! + * Copies \a ref. + */ void QTransform::copy(const QNode *ref) { QComponent::copy(ref); @@ -180,6 +295,11 @@ void QTransform::setRotationZ(float rotationZ) blockNotifications(wasBlocked); } +/*! + * \property Qt3DCore::QTransform::matrix + * + * Holds the QMatrix4x4 of the transform. + */ QMatrix4x4 QTransform::matrix() const { Q_D(const QTransform); @@ -190,18 +310,33 @@ QMatrix4x4 QTransform::matrix() const return d->m_matrix; } +/*! + * \property Qt3DCore::QTransform::rotationX + * + * Holds the x rotation of the transform as Euler angle. + */ float QTransform::rotationX() const { Q_D(const QTransform); return d->m_eulerRotationAngles.x(); } +/*! + * \property Qt3DCore::QTransform::rotationY + * + * Holds the y rotation of the transform as Euler angle. + */ float QTransform::rotationY() const { Q_D(const QTransform); return d->m_eulerRotationAngles.y(); } +/*! + * \property Qt3DCore::QTransform::rotationZ + * + * Holds the z rotation of the transform as Euler angle. + */ float QTransform::rotationZ() const { Q_D(const QTransform); @@ -218,6 +353,11 @@ void QTransform::setScale3D(const QVector3D &scale) } } +/*! + * \property Qt3DCore::QTransform::scale3D + * + * Holds the scale of the transform as QVector3D. + */ QVector3D QTransform::scale3D() const { Q_D(const QTransform); @@ -235,6 +375,12 @@ void QTransform::setScale(float scale) } } +/*! + * \property Qt3DCore::QTransform::scale + * + * Holds the uniform scale of the transform. If the scale has been set with setScale3D, holds + * the x value only. + */ float QTransform::scale() const { Q_D(const QTransform); @@ -252,6 +398,11 @@ void QTransform::setRotation(const QQuaternion &rotation) } } +/*! + * \property Qt3DCore::QTransform::rotation + * + * Holds the rotation of the transform as QQuaternion. + */ QQuaternion QTransform::rotation() const { Q_D(const QTransform); @@ -268,22 +419,39 @@ void QTransform::setTranslation(const QVector3D &translation) } } +/*! + * \property Qt3DCore::QTransform::translation + * + * Holds the translation of the transform as QVector3D. + */ QVector3D QTransform::translation() const { Q_D(const QTransform); return d->m_translation; } +/*! + * Creates a QQuaternion from \a axis and \a angle. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromAxisAndAngle(const QVector3D &axis, float angle) { return QQuaternion::fromAxisAndAngle(axis, angle); } +/*! + * Creates a QQuaternion from \a x, \a y, \a z, and \a angle. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromAxisAndAngle(float x, float y, float z, float angle) { return QQuaternion::fromAxisAndAngle(x, y, z, angle); } +/*! + * Creates a QQuaternion from \a axis1, \a angle1, \a axis2, and \a angle2. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, const QVector3D &axis2, float angle2) { @@ -292,6 +460,10 @@ QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, return q2 * q1; } +/*! + * Creates a QQuaternion from \a axis1, \a angle1, \a axis2, \a angle2, \a axis3, and \a angle3. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, const QVector3D &axis2, float angle2, const QVector3D &axis3, float angle3) @@ -302,16 +474,28 @@ QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, return q3 * q2 * q1; } +/*! + * Creates a QQuaternion from \a eulerAngles. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromEulerAngles(const QVector3D &eulerAngles) { return QQuaternion::fromEulerAngles(eulerAngles); } +/*! + * Creates a QQuaternion from \a pitch, \a yaw, and \a roll. + * \return the resulting QQuaternion. + */ QQuaternion QTransform::fromEulerAngles(float pitch, float yaw, float roll) { return QQuaternion::fromEulerAngles(pitch, yaw, roll); } +/*! + * Creates a rotation matrix from \a axis and \a angle around \a point. + * \return the resulting QMatrix4x4. + */ QMatrix4x4 QTransform::rotateAround(const QVector3D &point, float angle, const QVector3D &axis) { QMatrix4x4 m; |