diff options
Diffstat (limited to 'src/datavisualization/engine/bars3drenderer_p.h')
-rw-r--r-- | src/datavisualization/engine/bars3drenderer_p.h | 87 |
1 files changed, 32 insertions, 55 deletions
diff --git a/src/datavisualization/engine/bars3drenderer_p.h b/src/datavisualization/engine/bars3drenderer_p.h index 3ca38e39..d6c3c471 100644 --- a/src/datavisualization/engine/bars3drenderer_p.h +++ b/src/datavisualization/engine/bars3drenderer_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -50,14 +24,14 @@ class QPoint; class QSizeF; QT_END_NAMESPACE -QT_BEGIN_NAMESPACE_DATAVISUALIZATION +QT_BEGIN_NAMESPACE class ShaderHelper; class LabelItem; class Q3DScene; class BarSeriesRenderCache; -class QT_DATAVISUALIZATION_EXPORT Bars3DRenderer : public Abstract3DRenderer +class Q_DATAVISUALIZATION_EXPORT Bars3DRenderer : public Abstract3DRenderer { Q_OBJECT @@ -68,6 +42,7 @@ private: bool m_cachedIsSlicingActivated; int m_cachedRowCount; int m_cachedColumnCount; + QSizeF m_cachedBarSeriesMargin; // Internal state BarRenderItem *m_selectedBar; // points to renderitem array @@ -119,48 +94,49 @@ public: explicit Bars3DRenderer(Bars3DController *controller); ~Bars3DRenderer(); - void updateData(); - void updateSeries(const QList<QAbstract3DSeries *> &seriesList); - SeriesRenderCache *createNewCache(QAbstract3DSeries *series); + void updateData() override; + void updateSeries(const QList<QAbstract3DSeries *> &seriesList) override; + SeriesRenderCache *createNewCache(QAbstract3DSeries *series) override; void updateRows(const QList<Bars3DController::ChangeRow> &rows); void updateItems(const QList<Bars3DController::ChangeItem> &items); - void updateScene(Q3DScene *scene); - void render(GLuint defaultFboHandle = 0); + void updateScene(Q3DScene *scene) override; + void render(GLuint defaultFboHandle = 0) override; - QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute); + QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute) override; - void updateAspectRatio(float ratio); + void updateAspectRatio(float ratio) override; void updateFloorLevel(float level); - void updateMargin(float margin); + void updateMargin(float margin) override; protected: - void contextCleanup(); - virtual void initializeOpenGL(); - virtual void fixCameraTarget(QVector3D &target); - virtual void getVisibleItemBounds(QVector3D &minBounds, QVector3D &maxBounds); + void contextCleanup() override; + void initializeOpenGL() override; + void fixCameraTarget(QVector3D &target) override; + void getVisibleItemBounds(QVector3D &minBounds, QVector3D &maxBounds) override; public Q_SLOTS: void updateMultiSeriesScaling(bool uniform); void updateBarSpecs(GLfloat thicknessRatio = 1.0f, const QSizeF &spacing = QSizeF(1.0, 1.0), bool relative = true); + void updateBarSeriesMargin(const QSizeF &margin); void updateSlicingActive(bool isSlicing); void updateSelectedBar(const QPoint &position, QBar3DSeries *series); inline QPoint clickedPosition() const { return m_clickedPosition; } void resetClickedStatus(); // Overloaded from abstract renderer - virtual void updateAxisRange(QAbstract3DAxis::AxisOrientation orientation, float min, - float max); - virtual void updateAxisReversed(QAbstract3DAxis::AxisOrientation orientation, - bool enable); + void updateAxisRange(QAbstract3DAxis::AxisOrientation orientation, float min, + float max) override; + void updateAxisReversed(QAbstract3DAxis::AxisOrientation orientation, + bool enable) override; private: - virtual void initShaders(const QString &vertexShader, const QString &fragmentShader); - virtual void initGradientShaders(const QString &vertexShader, const QString &fragmentShader); - virtual void updateShadowQuality(QAbstract3DGraph::ShadowQuality quality); - virtual void updateTextures(); - virtual void fixMeshFileName(QString &fileName, QAbstract3DSeries::Mesh mesh); + void initShaders(const QString &vertexShader, const QString &fragmentShader) override; + void initGradientShaders(const QString &vertexShader, const QString &fragmentShader) override; + void updateShadowQuality(QAbstract3DGraph::ShadowQuality quality) override; + void updateTextures() override; + void fixMeshFileName(QString &fileName, QAbstract3DSeries::Mesh mesh) override; void drawSlicedScene(); void drawScene(GLuint defaultFboHandle); @@ -180,12 +156,13 @@ private: void loadBackgroundMesh(); void initSelectionShader(); - void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader); - void initSelectionBuffer(); + void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader) override; + void initSelectionBuffer() override; void initDepthShader(); - void updateDepthBuffer(); + void updateDepthBuffer() override; void calculateSceneScalingFactors(); void calculateHeightAdjustment(); + void calculateSeriesStartPosition(); Abstract3DController::SelectionType isSelected(int row, int bar, const BarSeriesRenderCache *cache); QPoint selectionColorToArrayPosition(const QVector4D &selectionColor); @@ -197,6 +174,6 @@ private: Q_DISABLE_COPY(Bars3DRenderer) }; -QT_END_NAMESPACE_DATAVISUALIZATION +QT_END_NAMESPACE #endif |