diff options
Diffstat (limited to 'src/datavisualization')
7 files changed, 49 insertions, 3 deletions
diff --git a/src/datavisualization/data/qbar3dseries.cpp b/src/datavisualization/data/qbar3dseries.cpp index 357feca6..6f0973cc 100644 --- a/src/datavisualization/data/qbar3dseries.cpp +++ b/src/datavisualization/data/qbar3dseries.cpp @@ -212,7 +212,7 @@ QBar3DSeriesPrivate::QBar3DSeriesPrivate(QBar3DSeries *q) : QAbstract3DSeriesPrivate(q, QAbstract3DSeries::SeriesTypeBar), m_selectedBar(Bars3DController::invalidSelectionPosition()) { - m_itemLabelFormat = QStringLiteral("@valueTitle: @valueLabel"); + m_itemLabelFormat = QStringLiteral("@valueLabel"); m_mesh = QAbstract3DSeries::MeshBevelBar; } diff --git a/src/datavisualization/data/qscatter3dseries.cpp b/src/datavisualization/data/qscatter3dseries.cpp index 8604c3f0..0e7ce921 100644 --- a/src/datavisualization/data/qscatter3dseries.cpp +++ b/src/datavisualization/data/qscatter3dseries.cpp @@ -237,7 +237,7 @@ QScatter3DSeriesPrivate::QScatter3DSeriesPrivate(QScatter3DSeries *q) m_selectedItem(Scatter3DController::invalidSelectionIndex()), m_itemSize(0.0f) { - m_itemLabelFormat = QStringLiteral("@valueTitle: @valueLabel"); + m_itemLabelFormat = QStringLiteral("@xLabel, @yLabel, @zLabel"); m_mesh = QAbstract3DSeries::MeshSphere; } diff --git a/src/datavisualization/data/qsurface3dseries.cpp b/src/datavisualization/data/qsurface3dseries.cpp index 1d456243..da285b2d 100644 --- a/src/datavisualization/data/qsurface3dseries.cpp +++ b/src/datavisualization/data/qsurface3dseries.cpp @@ -306,7 +306,7 @@ QSurface3DSeriesPrivate::QSurface3DSeriesPrivate(QSurface3DSeries *q) m_flatShadingEnabled(true), m_drawMode(QSurface3DSeries::DrawSurfaceAndWireframe) { - m_itemLabelFormat = QStringLiteral("(@xLabel, @yLabel, @zLabel)"); + m_itemLabelFormat = QStringLiteral("@xLabel, @yLabel, @zLabel"); m_mesh = QAbstract3DSeries::MeshSphere; } diff --git a/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc b/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc index 21dabf66..5ac6a03f 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc @@ -42,6 +42,11 @@ */ /*! + \qmlproperty Scene3D AbstractGraph3D::scene + Read only Q3DScene that can be used to access e.g. camera object. + */ + +/*! \qmlproperty AbstractInputHandler3D AbstractGraph3D::inputHandler Input handler. You can disable default input handlers by setting this property to \c null. */ @@ -50,3 +55,24 @@ \qmlproperty Theme3D AbstractGraph3D::theme The active theme of the graph. */ + +/*! + \qmlproperty bool AbstractGraph3D::clearWindowBeforeRendering + + Indicates if the graph should also clear the whole window before rendering the graph, + including the areas outside the graph. + Since the graphs are drawn first under other QML items, the regular QML window clearing + before rendering is suppressed when there are any graphs in the window; the graphs + handle the clearing themselves instead. + If you have any other items besides graphs that do similar + custom drawing under other QML items, you need to set this property to false on all graphs + drawn to same window with the other custom items, or it is likely that the + other custom items do not render properly. + Defaults to true. + + \note This property should be set to the same value for all graphs in the same window. + Otherwise some graphs may not show. + + \note If window clearing before rendering is suppressed, any areas of the window not fully + covered with opaque items may not draw properly. + */ diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index 32435946..19b9a8c8 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -122,9 +122,15 @@ void Abstract3DRenderer::render(const GLuint defaultFboHandle) m_viewport.y(), m_viewport.width(), m_viewport.height()); + glScissor(m_viewport.x(), + m_viewport.y(), + m_viewport.width(), + m_viewport.height()); + glEnable(GL_SCISSOR_TEST); QVector3D clearColor = Utils::vectorFromColor(m_cachedTheme->windowColor()); glClearColor(clearColor.x(), clearColor.y(), clearColor.z(), 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glDisable(GL_SCISSOR_TEST); } QString Abstract3DRenderer::generateValueLabel(const QString &format, float value) diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp index b70fd5b4..85863519 100644 --- a/src/datavisualization/engine/scatter3drenderer.cpp +++ b/src/datavisualization/engine/scatter3drenderer.cpp @@ -454,6 +454,10 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle) && SelectOnScene == m_selectionState && seriesCount > 0) { // Draw dots to selection buffer glBindFramebuffer(GL_FRAMEBUFFER, m_selectionFrameBuffer); + glViewport(0, 0, + m_primarySubViewport.width(), + m_primarySubViewport.height()); + glEnable(GL_DEPTH_TEST); // Needed, otherwise the depth render buffer is not used glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Set clear color to white (= skipColor) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Needed for clearing the frame buffer @@ -552,7 +556,12 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle) selectionColorToSeriesAndIndex(clickedColor, clickedIndex, clickedSeries); emit itemClicked(clickedIndex, clickedSeries); + // Revert to original fbo and viewport glBindFramebuffer(GL_FRAMEBUFFER, defaultFboHandle); + glViewport(m_primarySubViewport.x(), + m_primarySubViewport.y(), + m_primarySubViewport.width(), + m_primarySubViewport.height()); #if 0 // Use this if you want to see what is being drawn to the framebuffer m_labelShader->bind(); diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp index 912edd97..13a95670 100644 --- a/src/datavisualization/engine/surface3drenderer.cpp +++ b/src/datavisualization/engine/surface3drenderer.cpp @@ -881,6 +881,7 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) // Render scene into a depth texture for using with shadow mapping // Enable drawing to depth framebuffer glBindFramebuffer(GL_FRAMEBUFFER, m_depthFrameBuffer); + // Attach texture to depth attachment glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_depthTexture, 0); glClear(GL_DEPTH_BUFFER_BIT); @@ -2147,6 +2148,10 @@ void Surface3DRenderer::updateDepthBuffer() m_textureHelper->deleteTexture(&m_depthTexture); m_depthTexture = 0; } + if (m_depthModelTexture) { + m_textureHelper->deleteTexture(&m_depthModelTexture); + m_depthModelTexture = 0; + } if (m_primarySubViewport.size().isEmpty()) return; |