diff options
Diffstat (limited to 'src/datavisualization/data/qabstract3dseries.cpp')
-rw-r--r-- | src/datavisualization/data/qabstract3dseries.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/datavisualization/data/qabstract3dseries.cpp b/src/datavisualization/data/qabstract3dseries.cpp index a3f766a8..d80879f0 100644 --- a/src/datavisualization/data/qabstract3dseries.cpp +++ b/src/datavisualization/data/qabstract3dseries.cpp @@ -142,6 +142,18 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! + * \qmlproperty quaternion Abstract3DSeries::meshRotation + * + * Sets the mesh \a rotation that is applied to all items of the series. + * The \a rotation should be a normalized quaternion. + * For those series types that support item specific rotation, the rotations are + * multiplied together. + * Bar3DSeries ignores any rotation that is not around Y-axis. + * Surface3DSeries applies the rotation only to the selection pointer. + * Defaults to no rotation. + */ + +/*! * \qmlproperty string Abstract3DSeries::userDefinedMesh * * Sets the \a fileName for user defined custom mesh for objects that is used when mesh @@ -303,7 +315,8 @@ bool QAbstract3DSeries::isVisible() const */ void QAbstract3DSeries::setMesh(QAbstract3DSeries::Mesh mesh) { - if ((mesh == QAbstract3DSeries::MeshPoint || mesh == QAbstract3DSeries::MeshMinimal) + if ((mesh == QAbstract3DSeries::MeshPoint || mesh == QAbstract3DSeries::MeshMinimal + || mesh == QAbstract3DSeries::MeshArrow) && type() != QAbstract3DSeries::SeriesTypeScatter) { qWarning() << "Specified style is only supported for QScatter3DSeries."; } else if (d_ptr->m_mesh != mesh) { @@ -338,6 +351,30 @@ bool QAbstract3DSeries::isMeshSmooth() const } /*! + * \property QAbstract3DSeries::meshRotation + * + * Sets the mesh \a rotation that is applied to all items of the series. + * The \a rotation should be a normalized QQuaternion. + * For those series types that support item specific rotation, the rotations are + * multiplied together. + * QBar3DSeries ignores any rotation that is not around Y-axis. + * QSurface3DSeries applies the rotation only to the selection pointer. + * Defaults to no rotation. + */ +void QAbstract3DSeries::setMeshRotation(const QQuaternion &rotation) +{ + if (d_ptr->m_meshRotation != rotation) { + d_ptr->setMeshRotation(rotation); + emit meshRotationChanged(rotation); + } +} + +QQuaternion QAbstract3DSeries::meshRotation() const +{ + return d_ptr->m_meshRotation; +} + +/*! * \property QAbstract3DSeries::userDefinedMesh * * Sets the \a fileName for user defined custom mesh for objects that is used when mesh @@ -608,6 +645,14 @@ void QAbstract3DSeriesPrivate::setMeshSmooth(bool enable) m_controller->markSeriesVisualsDirty(); } +void QAbstract3DSeriesPrivate::setMeshRotation(const QQuaternion &rotation) +{ + m_meshRotation = rotation; + m_changeTracker.meshRotationChanged = true; + if (m_controller) + m_controller->markSeriesVisualsDirty(); +} + void QAbstract3DSeriesPrivate::setUserDefinedMesh(const QString &meshFile) { m_userDefinedMesh = meshFile; |