diff options
Diffstat (limited to 'src/datavisualization/data/qitemmodelscatterdataproxy.cpp')
-rw-r--r-- | src/datavisualization/data/qitemmodelscatterdataproxy.cpp | 68 |
1 files changed, 24 insertions, 44 deletions
diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp index b73538e9..4f407075 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp +++ b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp @@ -93,15 +93,13 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty string ItemModelScatterDataProxy::rotationAxisRole + * \qmlproperty string ItemModelScatterDataProxy::rotationRole * - * Defines the rotation axis role for the mapping. - */ - -/*! - * \qmlproperty string ItemModelScatterDataProxy::rotationAngleRole - * - * Defines the rotation angle role for the mapping. + * Defines the rotation role for the mapping. + * The model may supply the value for rotation as either variant that is directly convertible + * to QQuaternion, or as one of the string representations: \c{"scalar,x,y,z"} or \c{"@angle,x,y,z"}. The first + * will construct the quaternion directly with given values, and the second one will construct + * the quaternion using QQuaternion::fromAxisAndAngle() method. */ /*! @@ -149,15 +147,13 @@ QItemModelScatterDataProxy::QItemModelScatterDataProxy(const QAbstractItemModel * Constructs QItemModelScatterDataProxy with \a itemModel and optional \a parent. Proxy doesn't take * ownership of the \a itemModel, as typically item models are owned by other controls. * The xPosRole property is set to \a xPosRole, yPosRole property to \a yPosRole, zPosRole property - * to \a zPosRole, rotationAxisRole property to \a rotationAxisRole, and rotationAngleRole - * property to \a rotationAngleRole. + * to \a zPosRole, and rotationRole property to \a rotationRole. */ QItemModelScatterDataProxy::QItemModelScatterDataProxy(const QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, - const QString &rotationAxisRole, - const QString &rotationAngleRole, + const QString &rotationRole, QObject *parent) : QScatterDataProxy(new QItemModelScatterDataProxyPrivate(this), parent) { @@ -165,8 +161,7 @@ QItemModelScatterDataProxy::QItemModelScatterDataProxy(const QAbstractItemModel dptr()->m_xPosRole = xPosRole; dptr()->m_yPosRole = yPosRole; dptr()->m_zPosRole = zPosRole; - dptr()->m_rotationAxisRole = rotationAxisRole; - dptr()->m_rotationAngleRole = rotationAngleRole; + dptr()->m_rotationRole = rotationRole; dptr()->connectItemModelHandler(); } @@ -248,53 +243,38 @@ QString QItemModelScatterDataProxy::zPosRole() const } /*! - * \property QItemModelScatterDataProxy::rotationAxisRole + * \property QItemModelScatterDataProxy::rotationRole * - * Defines the rotation axis role for the mapping. - */ -void QItemModelScatterDataProxy::setRotationAxisRole(const QString &role) -{ - if (dptr()->m_rotationAxisRole != role) { - dptr()->m_rotationAxisRole = role; - emit rotationAxisRoleChanged(role); - } -} - -QString QItemModelScatterDataProxy::rotationAxisRole() const -{ - return dptrc()->m_rotationAxisRole; -} - -/*! - * \property QItemModelScatterDataProxy::rotationAngleRole + * Defines the rotation role for the mapping. * - * Defines the rotation angle role for the mapping. + * The model may supply the value for rotation as either variant that is directly convertible + * to QQuartenion, or as one of the string representations: \c{"scalar,x,y,z"} or \c{"@angle,x,y,z"}. The first + * will construct the quaternion directly with given values, and the second one will construct + * the quaternion using QQuaternion::fromAxisAndAngle() method. */ -void QItemModelScatterDataProxy::setRotationAngleRole(const QString &role) +void QItemModelScatterDataProxy::setRotationRole(const QString &role) { - if (dptr()->m_rotationAngleRole != role) { - dptr()->m_rotationAngleRole = role; - emit rotationAngleRoleChanged(role); + if (dptr()->m_rotationRole != role) { + dptr()->m_rotationRole = role; + emit rotationRoleChanged(role); } } -QString QItemModelScatterDataProxy::rotationAngleRole() const +QString QItemModelScatterDataProxy::rotationRole() const { - return dptrc()->m_rotationAngleRole; + return dptrc()->m_rotationRole; } /*! - * Changes \a xPosRole, \a yPosRole, \a zPosRole, \a rotationAxis, and \a rotationAngle mapping. + * Changes \a xPosRole, \a yPosRole, \a zPosRole, and \a rotationRole mapping. */ void QItemModelScatterDataProxy::remap(const QString &xPosRole, const QString &yPosRole, - const QString &zPosRole, const QString &rotationAxis, - const QString &rotationAngle) + const QString &zPosRole, const QString &rotationRole) { setXPosRole(xPosRole); setYPosRole(yPosRole); setZPosRole(zPosRole); - setRotationAxisRole(rotationAxis); - setRotationAngleRole(rotationAngle); + setRotationRole(rotationRole); } /*! |