diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datavisualization/engine/abstract3dcontroller.cpp | 15 | ||||
-rw-r--r-- | src/datavisualization/engine/abstract3dcontroller_p.h | 8 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dbars.cpp | 96 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dbars.h | 25 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dscatter.cpp | 42 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dscatter.h | 9 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativebars.cpp | 11 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativebars_p.h | 4 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativescatter.cpp | 11 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativescatter_p.h | 4 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativesurface.cpp | 15 | ||||
-rw-r--r-- | src/datavisualizationqml2/declarativesurface_p.h | 1 |
12 files changed, 161 insertions, 80 deletions
diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index e560deaf..03a0f416 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -662,6 +662,11 @@ void Abstract3DController::setCameraPreset(QDataVis::CameraPreset preset) emitNeedRender(); } +QDataVis::CameraPreset Abstract3DController::cameraPreset() const +{ + return m_scene->camera()->cameraPreset(); +} + void Abstract3DController::setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance) { m_horizontalRotation = qBound(-180.0f, horizontal, 180.0f); @@ -673,18 +678,20 @@ void Abstract3DController::setCameraPosition(GLfloat horizontal, GLfloat vertica emitNeedRender(); } -void Abstract3DController::setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform) +void Abstract3DController::setObjectColor(const QColor &baseColor, bool uniform) { m_theme.m_baseColor = baseColor; - m_theme.m_heightColor = heightColor; - m_theme.m_depthColor = depthColor; m_theme.m_uniformColor = uniform; m_changeTracker.themeChanged = true; emitNeedRender(); } +QColor Abstract3DController::objectColor() const +{ + return m_theme.m_baseColor; +} + void Abstract3DController::setColorTheme(QDataVis::ColorTheme colorTheme) { m_theme.useColorTheme(colorTheme); diff --git a/src/datavisualization/engine/abstract3dcontroller_p.h b/src/datavisualization/engine/abstract3dcontroller_p.h index c406f087..c08a7cab 100644 --- a/src/datavisualization/engine/abstract3dcontroller_p.h +++ b/src/datavisualization/engine/abstract3dcontroller_p.h @@ -241,16 +241,16 @@ public: // Select preset camera placement virtual void setCameraPreset(QDataVis::CameraPreset preset); + virtual QDataVis::CameraPreset cameraPreset() const; // Set camera rotation if you don't want to use the presets (in horizontal (-180...180) and // vertical (0...90) (or (-90...90) if there are negative values) angles and distance in // percentage (10...500)) virtual void setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance = 100); - // Set color if you don't want to use themes. Set uniform to false if you want the (height) - // color to change from bottom to top - virtual void setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform = true); + // Set color if you don't want to use themes. + virtual void setObjectColor(const QColor &baseColor, bool uniform = true); + virtual QColor objectColor() const; // Set theme (bar colors, shaders, window color, background colors, light intensity and text // colors are affected) diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp index 8e281339..be8b3a88 100644 --- a/src/datavisualization/engine/q3dbars.cpp +++ b/src/datavisualization/engine/q3dbars.cpp @@ -342,16 +342,54 @@ void Q3DBars::setHeight(const int height) } /*! - * Sets bar specifications. Bar \a thicknessRatio specifies the ratio of a bar thickness between x - * and z axes. For example, setting the ratio to 2.0 means bars are twice as wide in x dimension - * as they are in z dimension. Bar \a spacing sets the spacing between bars in x and z axes. - * \a relative -flag is used to indicate if spacing is meant to be absolute or relative to bar - * thickness. If it is true, value of 0.0 means the bars are side-to-side and for example 1.0 means - * there is one thickness in between the bars. It is \c true by default. + * \property Q3DBars::barThickness + * + * Bar thickness ratio between X and Z dimensions. 1.0 means bars are as wide as they are deep, 0.5 + * makes them twice as deep as they are wide. It is preset to \c 1.0 by default. + */ +void Q3DBars::setBarThickness(qreal thicknessRatio) +{ + d_ptr->m_shared->setBarSpecs(GLfloat(thicknessRatio), barSpacing(), isBarSpacingRelative()); +} + +qreal Q3DBars::barThickness() +{ + return d_ptr->m_shared->barThickness(); +} + +/*! + * \property Q3DBars::barSpacing + * + * Bar spacing, ie. the empty space between bars, in X and Z dimensions. It is preset to + * \c {(1.0, 1.0)} by default. Spacing is affected by barSpacingRelative -property. + * + * \sa barSpacingRelative */ -void Q3DBars::setBarSpecs(qreal thicknessRatio, const QSizeF &spacing, bool relative) +void Q3DBars::setBarSpacing(QSizeF spacing) +{ + d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), spacing, isBarSpacingRelative()); +} + +QSizeF Q3DBars::barSpacing() { - d_ptr->m_shared->setBarSpecs(GLfloat(thicknessRatio), spacing, relative); + return d_ptr->m_shared->barSpacing(); +} + +/*! + * \property Q3DBars::barSpacingRelative + * + * This is used to indicate if spacing is meant to be absolute or relative to bar thickness. + * If it is true, value of 0.0 means the bars are side-to-side and for example 1.0 means + * there is one thickness in between the bars. It is preset to \c true. + */ +void Q3DBars::setBarSpacingRelative(bool relative) +{ + d_ptr->m_shared->setBarSpecs(GLfloat(barThickness()), barSpacing(), relative); +} + +bool Q3DBars::isBarSpacingRelative() +{ + return d_ptr->m_shared->isBarSpecRelative(); } /*! @@ -384,13 +422,20 @@ QSize Q3DBars::dataWindow() const } /*! - * Moves camera to a \a preset position. The position can be one of \c QDataVis::CameraPreset. + * \property Q3DBars::cameraPreset + * + * The \a preset position of the camera. The position can be one of \c QDataVis::CameraPreset. */ void Q3DBars::setCameraPreset(QDataVis::CameraPreset preset) { d_ptr->m_shared->setCameraPreset(preset); } +QDataVis::CameraPreset Q3DBars::cameraPreset() const +{ + return d_ptr->m_shared->cameraPreset(); +} + /*! * Move camera to a wanted position based on \a horizontal and \a vertical angles. Angles are limited * to -180...180 in horizontal direction and either -90...90 or 0...90 in vertical, depending @@ -408,6 +453,8 @@ void Q3DBars::setCameraPosition(qreal horizontal, qreal vertical, int distance) * grid color. Lighting is also adjusted by themes. * * \sa setBarColor() + * + * \warning This method is subject to change. */ void Q3DBars::setTheme(QDataVis::ColorTheme theme) { @@ -415,14 +462,9 @@ void Q3DBars::setTheme(QDataVis::ColorTheme theme) } /*! - * Set bar color using your own colors. \a baseColor sets the base color of a bar. If all other - * colors are black, this sets the final color of the bar if uniform is set to false. - * \a heightColor is added to the bar based on its height. The higher the bar, the more prominent - * this color becomes. Setting this black keeps the color unchanged regardless of height. - * \a depthColor becomes more prominent the further away from the first row the bar is. - * Setting this black keeps bars the same color regardless of "depth" in the set. \a uniform -flag - * is used to define if color needs to be uniform throughout bar's length, or will the colors be - * applied by height. It is \c true by default. + * Set bar color using your own color. \a baseColor sets the base color of a bar. The \a uniform + * -flag is used to define if color needs to be uniform throughout bar's length, or will the colors + * be applied by height, starting with dark at the bottom. It is \c true by default. * * Calling this method overrides colors from theme. * @@ -430,10 +472,17 @@ void Q3DBars::setTheme(QDataVis::ColorTheme theme) * * \warning This method is subject to change. */ -void Q3DBars::setBarColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform) +void Q3DBars::setBarColor(const QColor &baseColor, bool uniform) { - d_ptr->m_shared->setObjectColor(baseColor, heightColor, depthColor, uniform); + d_ptr->m_shared->setObjectColor(baseColor, uniform); +} + +/*! + * \return bar color in use. + */ +QColor Q3DBars::barColor() const +{ + return d_ptr->m_shared->objectColor(); } /*! @@ -453,6 +502,8 @@ QDataVis::SelectionMode Q3DBars::selectionMode() const } /*! + * \property Q3DBars::meshFileName + * * Override bar type with a mesh object located in \a objFileName. * \note Object needs to be in Wavefront obj format and include vertices, normals and UVs. * It also needs to be in triangles. @@ -464,6 +515,11 @@ void Q3DBars::setMeshFileName(const QString &objFileName) d_ptr->m_shared->setMeshFileName(objFileName); } +QString Q3DBars::meshFileName() const +{ + return d_ptr->m_shared->meshFileName(); +} + /*! * \property Q3DBars::font * diff --git a/src/datavisualization/engine/q3dbars.h b/src/datavisualization/engine/q3dbars.h index 92772799..1404ea05 100644 --- a/src/datavisualization/engine/q3dbars.h +++ b/src/datavisualization/engine/q3dbars.h @@ -37,6 +37,11 @@ class QT_DATAVISUALIZATION_EXPORT Q3DBars : public Q3DWindow Q_PROPERTY(QtDataVisualization::QDataVis::SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) Q_PROPERTY(QtDataVisualization::QDataVis::LabelTransparency labelTransparency READ labelTransparency WRITE setLabelTransparency) Q_PROPERTY(QtDataVisualization::QDataVis::ShadowQuality shadowQuality READ shadowQuality WRITE setShadowQuality NOTIFY shadowQualityChanged) + Q_PROPERTY(QtDataVisualization::QDataVis::CameraPreset cameraPreset READ cameraPreset WRITE setCameraPreset) + Q_PROPERTY(qreal barThickness READ barThickness WRITE setBarThickness) + Q_PROPERTY(QSizeF barSpacing READ barSpacing WRITE setBarSpacing) + Q_PROPERTY(bool barSpacingRelative READ isBarSpacingRelative WRITE setBarSpacingRelative) + Q_PROPERTY(QString meshFileName READ meshFileName WRITE setMeshFileName) Q_PROPERTY(QFont font READ font WRITE setFont) Q_PROPERTY(bool gridVisible READ isGridVisible WRITE setGridVisible) Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible) @@ -44,15 +49,12 @@ class QT_DATAVISUALIZATION_EXPORT Q3DBars : public Q3DWindow Q_ENUMS(QtDataVisualization::QDataVis::SelectionMode) Q_ENUMS(QtDataVisualization::QDataVis::ShadowQuality) Q_ENUMS(QtDataVisualization::QDataVis::LabelTransparency) + Q_ENUMS(QtDataVisualization::QDataVis::CameraPreset) public: explicit Q3DBars(); ~Q3DBars(); - void setBarSpecs(qreal thicknessRatio = 1.0, - const QSizeF &spacing = QSizeF(1.0, 1.0), - bool relative = true); - void setBarType(QDataVis::MeshStyle style, bool smooth = false); // TODO: This defines the data window, needs additional parameters startRow, startColumn @@ -60,15 +62,26 @@ public: QSize dataWindow() const; // TODO: Return QRect once data window properly implemented? void setCameraPreset(QDataVis::CameraPreset preset); + QDataVis::CameraPreset cameraPreset() const; void setCameraPosition(qreal horizontal, qreal vertical, int distance = 100); void setTheme(QDataVis::ColorTheme theme); - void setBarColor(const QColor &baseColor, const QColor &heightColor, const QColor &depthColor, - bool uniform = true); + void setBarThickness(qreal thicknessRatio); + qreal barThickness(); + + void setBarSpacing(QSizeF spacing); + QSizeF barSpacing(); + + void setBarSpacingRelative(bool relative); + bool isBarSpacingRelative(); + + void setBarColor(const QColor &baseColor, bool uniform = true); + QColor barColor() const; void setMeshFileName(const QString &objFileName); + QString meshFileName() const; void setSelectionMode(QDataVis::SelectionMode mode); QDataVis::SelectionMode selectionMode() const; diff --git a/src/datavisualization/engine/q3dscatter.cpp b/src/datavisualization/engine/q3dscatter.cpp index f034b816..bac9a38d 100644 --- a/src/datavisualization/engine/q3dscatter.cpp +++ b/src/datavisualization/engine/q3dscatter.cpp @@ -316,13 +316,20 @@ void Q3DScatter::setObjectType(QDataVis::MeshStyle style, bool smooth) } /*! - * Moves camera to a \a preset position. The position can be one of \c QDataVis::CameraPreset. + * \property Q3DScatter::cameraPreset + * + * The \a preset position of the camera. The position can be one of \c QDataVis::CameraPreset. */ void Q3DScatter::setCameraPreset(QDataVis::CameraPreset preset) { d_ptr->m_shared->setCameraPreset(preset); } +QDataVis::CameraPreset Q3DScatter::cameraPreset() const +{ + return d_ptr->m_shared->cameraPreset(); +} + /*! * Move camera to a wanted position based on \a horizontal and \a vertical angles. Angles are limited * to -180...180 in horizontal direction and -90...90 in vertical. \a distance is adjustable @@ -339,6 +346,8 @@ void Q3DScatter::setCameraPosition(qreal horizontal, qreal vertical, int distanc * grid color. Lighting is also adjusted by themes. * * \sa setObjectColor() + * + * \warning This method is subject to change. */ void Q3DScatter::setTheme(QDataVis::ColorTheme theme) { @@ -346,14 +355,9 @@ void Q3DScatter::setTheme(QDataVis::ColorTheme theme) } /*! - * Set item color using your own colors. \a baseColor sets the base color of a item. If all other - * colors are black, this sets the final color of the item if uniform is set to false. - * \a heightColor is added to the item based on its height. The higher the item, the more prominent - * this color becomes. Setting this black keeps the color unchanged regardless of height. - * \a depthColor becomes more prominent the further away from the first row the item is. - * Setting this black keeps items the same color regardless of "depth" in the set. \a uniform -flag - * is used to define if color needs to be uniform throughout item's length, or will the colors be - * applied by height. It is \c true by default. + * Set item color using your own colors. \a baseColor sets the base color of a item. The \a uniform + * -flag is used to define if color needs to be uniform throughout item's length, or will the colors + * be applied by height. It is \c true by default. * * Calling this method overrides colors from theme. * @@ -361,10 +365,17 @@ void Q3DScatter::setTheme(QDataVis::ColorTheme theme) * * \warning This method is subject to change. */ -void Q3DScatter::setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform) +void Q3DScatter::setObjectColor(const QColor &baseColor, bool uniform) { - d_ptr->m_shared->setObjectColor(baseColor, heightColor, depthColor, uniform); + d_ptr->m_shared->setObjectColor(baseColor, uniform); +} + +/*! + * \return item color in use. + */ +QColor Q3DScatter::objectColor() const +{ + return d_ptr->m_shared->objectColor(); } /*! @@ -384,6 +395,8 @@ QDataVis::SelectionMode Q3DScatter::selectionMode() const } /*! + * \property Q3DScatter::meshFileName + * * Override item type with a mesh object located in \a objFileName. * \note Object needs to be in Wavefront obj format and include vertices, normals and UVs. * It also needs to be in triangles. @@ -395,6 +408,11 @@ void Q3DScatter::setMeshFileName(const QString &objFileName) d_ptr->m_shared->setMeshFileName(objFileName); } +QString Q3DScatter::meshFileName() const +{ + return d_ptr->m_shared->meshFileName(); +} + /*! * \property Q3DScatter::font * diff --git a/src/datavisualization/engine/q3dscatter.h b/src/datavisualization/engine/q3dscatter.h index 4c65b83d..4160b168 100644 --- a/src/datavisualization/engine/q3dscatter.h +++ b/src/datavisualization/engine/q3dscatter.h @@ -37,6 +37,8 @@ class QT_DATAVISUALIZATION_EXPORT Q3DScatter : public Q3DWindow Q_PROPERTY(QtDataVisualization::QDataVis::SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) Q_PROPERTY(QtDataVisualization::QDataVis::LabelTransparency labelTransparency READ labelTransparency WRITE setLabelTransparency) Q_PROPERTY(QtDataVisualization::QDataVis::ShadowQuality shadowQuality READ shadowQuality WRITE setShadowQuality) + Q_PROPERTY(QtDataVisualization::QDataVis::CameraPreset cameraPreset READ cameraPreset WRITE setCameraPreset) + Q_PROPERTY(QString meshFileName READ meshFileName WRITE setMeshFileName) Q_PROPERTY(QFont font READ font WRITE setFont) Q_PROPERTY(bool gridVisible READ isGridVisible WRITE setGridVisible) Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible) @@ -44,6 +46,7 @@ class QT_DATAVISUALIZATION_EXPORT Q3DScatter : public Q3DWindow Q_ENUMS(QtDataVisualization::QDataVis::SelectionMode) Q_ENUMS(QtDataVisualization::QDataVis::ShadowQuality) Q_ENUMS(QtDataVisualization::QDataVis::LabelTransparency) + Q_ENUMS(QtDataVisualization::QDataVis::CameraPreset) public: explicit Q3DScatter(); @@ -52,15 +55,17 @@ public: void setObjectType(QDataVis::MeshStyle style, bool smooth = false); void setCameraPreset(QDataVis::CameraPreset preset); + QDataVis::CameraPreset cameraPreset() const; void setCameraPosition(qreal horizontal, qreal vertical, int distance = 100); void setTheme(QDataVis::ColorTheme theme); - void setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform = true); + void setObjectColor(const QColor &baseColor, bool uniform = true); + QColor objectColor() const; void setMeshFileName(const QString &objFileName); + QString meshFileName() const; void setSelectionMode(QDataVis::SelectionMode mode); QDataVis::SelectionMode selectionMode() const; diff --git a/src/datavisualizationqml2/declarativebars.cpp b/src/datavisualizationqml2/declarativebars.cpp index 3da8e416..7eee3e6d 100644 --- a/src/datavisualizationqml2/declarativebars.cpp +++ b/src/datavisualizationqml2/declarativebars.cpp @@ -29,7 +29,6 @@ DeclarativeBars::DeclarativeBars(QQuickItem *parent) : QQuickItem(parent), m_shared(0), m_initialisedSize(0, 0), - m_cameraPreset(QDataVis::NoPreset), m_theme(QDataVis::ThemeDefault) { setFlags(QQuickItem::ItemHasContents); @@ -86,10 +85,9 @@ void DeclarativeBars::setDataWindow(int rowCount, int columnCount) m_shared->setDataWindow(rowCount, columnCount); } -void DeclarativeBars::setBarColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform) +void DeclarativeBars::setBarColor(const QColor &baseColor, bool uniform) { - m_shared->setObjectColor(baseColor, heightColor, depthColor, uniform); + m_shared->setObjectColor(baseColor, uniform); } void DeclarativeBars::setCameraPosition(qreal horizontal, qreal vertical, int distance) @@ -218,15 +216,12 @@ QString DeclarativeBars::meshFileName() void DeclarativeBars::setCameraPreset(QDataVis::CameraPreset preset) { - // TODO: Implement correctly once "improved camera api" (QTRD-2122) is implemented - // We need to save this locally, as there are no getters for it in controller - m_cameraPreset = preset; m_shared->setCameraPreset(preset); } QDataVis::CameraPreset DeclarativeBars::cameraPreset() { - return m_cameraPreset; + return m_shared->cameraPreset(); } void DeclarativeBars::setTheme(QDataVis::ColorTheme theme) diff --git a/src/datavisualizationqml2/declarativebars_p.h b/src/datavisualizationqml2/declarativebars_p.h index f86efe79..a85bc2da 100644 --- a/src/datavisualizationqml2/declarativebars_p.h +++ b/src/datavisualizationqml2/declarativebars_p.h @@ -84,8 +84,7 @@ public: // Set color if you don't want to use themes. Set uniform to false if you want the (height) // color to change from bottom to top - Q_INVOKABLE void setBarColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform = true); + Q_INVOKABLE void setBarColor(const QColor &baseColor, bool uniform = true); // Set camera rotation if you don't want to use the presets (in horizontal (-180...180) and // vertical (0...90) (or (-90...90) if there are negative values) angles and distance in @@ -193,7 +192,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::CameraPreset m_cameraPreset; QDataVis::ColorTheme m_theme; }; diff --git a/src/datavisualizationqml2/declarativescatter.cpp b/src/datavisualizationqml2/declarativescatter.cpp index 64bd324f..3c3b1371 100644 --- a/src/datavisualizationqml2/declarativescatter.cpp +++ b/src/datavisualizationqml2/declarativescatter.cpp @@ -28,7 +28,6 @@ DeclarativeScatter::DeclarativeScatter(QQuickItem *parent) : QQuickItem(parent), m_shared(0), m_initialisedSize(0, 0), - m_cameraPreset(QDataVis::NoPreset), m_theme(QDataVis::ThemeDefault) { setFlags(QQuickItem::ItemHasContents); @@ -84,10 +83,9 @@ void DeclarativeScatter::setCameraPosition(qreal horizontal, qreal vertical, int m_shared->setCameraPosition(GLfloat(horizontal), GLfloat(vertical), GLint(distance)); } -void DeclarativeScatter::setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform) +void DeclarativeScatter::setObjectColor(const QColor &baseColor, bool uniform) { - m_shared->setObjectColor(baseColor, heightColor, depthColor, uniform); + m_shared->setObjectColor(baseColor, uniform); } QScatterDataProxy *DeclarativeScatter::dataProxy() const @@ -181,15 +179,12 @@ QString DeclarativeScatter::meshFileName() void DeclarativeScatter::setCameraPreset(QDataVis::CameraPreset preset) { - // TODO: Implement correctly once "improved camera api" (QTRD-2122) is implemented - // We need to save this locally, as there are no getters for it in controller - m_cameraPreset = preset; m_shared->setCameraPreset(preset); } QDataVis::CameraPreset DeclarativeScatter::cameraPreset() { - return m_cameraPreset; + return m_shared->cameraPreset(); } void DeclarativeScatter::setTheme(QDataVis::ColorTheme theme) diff --git a/src/datavisualizationqml2/declarativescatter_p.h b/src/datavisualizationqml2/declarativescatter_p.h index 80137507..6c70a146 100644 --- a/src/datavisualizationqml2/declarativescatter_p.h +++ b/src/datavisualizationqml2/declarativescatter_p.h @@ -77,8 +77,7 @@ public: // Set color if you don't want to use themes. Set uniform to false if you want the (height) // color to change from bottom to top - Q_INVOKABLE void setObjectColor(const QColor &baseColor, const QColor &heightColor, - const QColor &depthColor, bool uniform = true); + Q_INVOKABLE void setObjectColor(const QColor &baseColor, bool uniform = true); QScatterDataProxy *dataProxy() const; void setDataProxy(QScatterDataProxy *dataProxy); @@ -158,7 +157,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::CameraPreset m_cameraPreset; QDataVis::ColorTheme m_theme; }; diff --git a/src/datavisualizationqml2/declarativesurface.cpp b/src/datavisualizationqml2/declarativesurface.cpp index c3c5dd09..d238c9ad 100644 --- a/src/datavisualizationqml2/declarativesurface.cpp +++ b/src/datavisualizationqml2/declarativesurface.cpp @@ -27,7 +27,6 @@ DeclarativeSurface::DeclarativeSurface(QQuickItem *parent) : QQuickItem(parent), m_shared(0), m_initialisedSize(0, 0), - m_cameraPreset(QDataVis::NoPreset), m_theme(QDataVis::ThemeDefault) { setFlags(QQuickItem::ItemHasContents); @@ -96,12 +95,15 @@ QSurfaceDataProxy *DeclarativeSurface::dataProxy() const void DeclarativeSurface::setCameraPreset(QDataVis::CameraPreset preset) { - // TODO: Implement correctly once "improved camera api" (QTRD-2122) is implemented - // We need to save this locally, as there are no getters for it in controller - m_cameraPreset = preset; m_shared->setCameraPreset(preset); } +QDataVis::CameraPreset DeclarativeSurface::cameraPreset() +{ + return m_shared->cameraPreset(); + +} + Q3DValueAxis *DeclarativeSurface::axisX() const { return static_cast<Q3DValueAxis *>(m_shared->axisX()); @@ -132,11 +134,6 @@ void DeclarativeSurface::setAxisZ(Q3DValueAxis *axis) m_shared->setAxisZ(axis); } -QDataVis::CameraPreset DeclarativeSurface::cameraPreset() -{ - return m_cameraPreset; -} - void DeclarativeSurface::setTheme(QDataVis::ColorTheme theme) { // TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented diff --git a/src/datavisualizationqml2/declarativesurface_p.h b/src/datavisualizationqml2/declarativesurface_p.h index 180e1cc4..cc20449d 100644 --- a/src/datavisualizationqml2/declarativesurface_p.h +++ b/src/datavisualizationqml2/declarativesurface_p.h @@ -147,7 +147,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::CameraPreset m_cameraPreset; QDataVis::ColorTheme m_theme; }; |