diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-06-25 13:00:55 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-06-26 10:43:39 +0300 |
commit | 36417dd3660f75c34328c3420bdd512436da86ff (patch) | |
tree | b940d98d8df6a8a64adc1a638c57f20a4a955c5b /src/datavisualization/engine/surface3dcontroller.cpp | |
parent | ec195a34594dea6145af5e8f2fedc2f9401d0f14 (diff) |
Add flipHorizontalGrid property for surface
This property allows drawind the horizontal grid and axis labels on
top of the graph rather than on the bottom. This is useful when
surface graph is used for 2D spectrograms in orthographic mode, as
otherwise the grid is covered by the surface itself. Particularly
relevant for polar plots of the same.
Task-number: QTRD-3184
Change-Id: I9dbcdbfc754e13af52d2cf31a1d9991ef4b241f7
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'src/datavisualization/engine/surface3dcontroller.cpp')
-rw-r--r-- | src/datavisualization/engine/surface3dcontroller.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/datavisualization/engine/surface3dcontroller.cpp b/src/datavisualization/engine/surface3dcontroller.cpp index c03bafd8..5293cb0c 100644 --- a/src/datavisualization/engine/surface3dcontroller.cpp +++ b/src/datavisualization/engine/surface3dcontroller.cpp @@ -29,7 +29,8 @@ Surface3DController::Surface3DController(QRect rect, Q3DScene *scene) m_renderer(0), m_selectedPoint(invalidSelectionPosition()), m_selectedSeries(0), - m_flatShadingSupported(true) + m_flatShadingSupported(true), + m_flipHorizontalGrid(false) { // Setting a null axis creates a new default axis according to orientation and graph type. // Note: these cannot be set in the Abstract3DController constructor, as they will call virtual @@ -79,6 +80,11 @@ void Surface3DController::synchDataToRenderer() m_renderer->updateSelectedPoint(m_selectedPoint, m_selectedSeries); m_changeTracker.selectedPointChanged = false; } + + if (m_changeTracker.flipHorizontalGridChanged) { + m_renderer->updateFlipHorizontalGrid(m_flipHorizontalGrid); + m_changeTracker.flipHorizontalGridChanged = false; + } } void Surface3DController::handleAxisAutoAdjustRangeChangedInOrientation( @@ -168,6 +174,21 @@ QList<QSurface3DSeries *> Surface3DController::surfaceSeriesList() return surfaceSeriesList; } +void Surface3DController::setFlipHorizontalGrid(bool flip) +{ + if (m_flipHorizontalGrid != flip) { + m_flipHorizontalGrid = flip; + m_changeTracker.flipHorizontalGridChanged = true; + emit flipHorizontalGridChanged(flip); + emitNeedRender(); + } +} + +bool Surface3DController::flipHorizontalGrid() const +{ + return m_flipHorizontalGrid; +} + void Surface3DController::setSelectionMode(QAbstract3DGraph::SelectionFlags mode) { // Currently surface only supports row and column modes when also slicing |