diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-09-25 15:04:44 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-09-26 10:06:52 +0300 |
commit | 0ab45b018fa98e9ef6cffd70178f208eb4f16550 (patch) | |
tree | 77d324f47ccb52cc543df9e8990153b82ead2688 /src/datavisualization/engine/bars3drenderer.cpp | |
parent | 36bc54f5720bddb9899e64d665117ac1e1b5bc94 (diff) |
Implement zooming to cursor
Zooming to cursor is now default operating mode of
the default input handler.
Task-number: QTRD-3263
Change-Id: I5699fc0ce7393059538972cd52f31f06d87e3d8d
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/engine/bars3drenderer.cpp')
-rw-r--r-- | src/datavisualization/engine/bars3drenderer.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index 9f3c2e2a..2d394d57 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -122,9 +122,6 @@ void Bars3DRenderer::initializeOpenGL() // Load grid line mesh loadGridLineMesh(); - // Load label mesh - loadLabelMesh(); - // Load background mesh (we need to be initialized first) loadBackgroundMesh(); } @@ -1161,6 +1158,16 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) } #endif + // Do position mapping when necessary + if (m_graphPositionQueryPending) { + QVector3D graphDimensions(m_xScaleFactor, 0.0f, m_zScaleFactor); + queriedGraphPosition(projectionViewMatrix, graphDimensions, defaultFboHandle); + + // Y is always at floor level + m_queriedGraphPosition.setY(0.0f); + emit needRender(); + } + // Skip selection mode drawing if we're slicing or have no selection mode if (!m_cachedIsSlicingActivated && m_cachedSelectionMode > QAbstract3DGraph::SelectionNone && m_selectionState == SelectOnScene @@ -2732,8 +2739,11 @@ void Bars3DRenderer::updateSlicingActive(bool isSlicing) m_cachedIsSlicingActivated = isSlicing; - if (!m_cachedIsSlicingActivated) - initSelectionBuffer(); // We need to re-init selection buffer in case there has been a resize + if (!m_cachedIsSlicingActivated) { + // We need to re-init selection buffer in case there has been a resize + initSelectionBuffer(); + initCursorPositionBuffer(); + } #if !defined(QT_OPENGL_ES_2) updateDepthBuffer(); // Re-init depth buffer as well |