summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/data/qabstract3dseries.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-24 13:45:18 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-27 07:51:17 +0200
commit71b501d31ae7c5d3aab987b54acccecce1136896 (patch)
tree7898e60da146dadd8ed665b21d35960efa5f61fa /src/datavisualization/data/qabstract3dseries.cpp
parent8178f10769f7f7d84d4d1180994d0232e5fc8f93 (diff)
Added series rotation and bar item rotation support
Task-number: QTRD-2654 Change-Id: I864d33bc173b35b8680eddb402bdf1817ecb031f Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/data/qabstract3dseries.cpp')
-rw-r--r--src/datavisualization/data/qabstract3dseries.cpp47
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;