summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/datavisualization/engine')
-rw-r--r--src/datavisualization/engine/abstract3dcontroller.cpp62
-rw-r--r--src/datavisualization/engine/abstract3dcontroller_p.h43
-rw-r--r--src/datavisualization/engine/abstract3drenderer.cpp83
-rw-r--r--src/datavisualization/engine/abstract3drenderer_p.h44
-rw-r--r--src/datavisualization/engine/abstractdeclarativeinterface.cpp11
-rw-r--r--src/datavisualization/engine/abstractdeclarativeinterface_p.h31
-rw-r--r--src/datavisualization/engine/axisrendercache.cpp36
-rw-r--r--src/datavisualization/engine/axisrendercache_p.h34
-rw-r--r--src/datavisualization/engine/bars3dcontroller.cpp59
-rw-r--r--src/datavisualization/engine/bars3dcontroller_p.h81
-rw-r--r--src/datavisualization/engine/bars3drenderer.cpp92
-rw-r--r--src/datavisualization/engine/bars3drenderer_p.h87
-rw-r--r--src/datavisualization/engine/barseriesrendercache.cpp34
-rw-r--r--src/datavisualization/engine/barseriesrendercache_p.h36
-rw-r--r--src/datavisualization/engine/drawer.cpp47
-rw-r--r--src/datavisualization/engine/drawer_p.h45
-rw-r--r--src/datavisualization/engine/engine.pri61
-rw-r--r--src/datavisualization/engine/engine.qrc74
-rw-r--r--src/datavisualization/engine/q3dbars.cpp71
-rw-r--r--src/datavisualization/engine/q3dbars.h41
-rw-r--r--src/datavisualization/engine/q3dbars_p.h40
-rw-r--r--src/datavisualization/engine/q3dcamera.cpp34
-rw-r--r--src/datavisualization/engine/q3dcamera.h50
-rw-r--r--src/datavisualization/engine/q3dcamera_p.h36
-rw-r--r--src/datavisualization/engine/q3dlight.cpp34
-rw-r--r--src/datavisualization/engine/q3dlight.h40
-rw-r--r--src/datavisualization/engine/q3dlight_p.h34
-rw-r--r--src/datavisualization/engine/q3dobject.cpp34
-rw-r--r--src/datavisualization/engine/q3dobject.h36
-rw-r--r--src/datavisualization/engine/q3dobject_p.h34
-rw-r--r--src/datavisualization/engine/q3dscatter.cpp44
-rw-r--r--src/datavisualization/engine/q3dscatter.h36
-rw-r--r--src/datavisualization/engine/q3dscatter_p.h40
-rw-r--r--src/datavisualization/engine/q3dscene.cpp34
-rw-r--r--src/datavisualization/engine/q3dscene.h40
-rw-r--r--src/datavisualization/engine/q3dscene_p.h40
-rw-r--r--src/datavisualization/engine/q3dsurface.cpp44
-rw-r--r--src/datavisualization/engine/q3dsurface.h36
-rw-r--r--src/datavisualization/engine/q3dsurface_p.h40
-rw-r--r--src/datavisualization/engine/qabstract3dgraph.cpp61
-rw-r--r--src/datavisualization/engine/qabstract3dgraph.h65
-rw-r--r--src/datavisualization/engine/qabstract3dgraph_p.h34
-rw-r--r--src/datavisualization/engine/scatter3dcontroller.cpp36
-rw-r--r--src/datavisualization/engine/scatter3dcontroller_p.h64
-rw-r--r--src/datavisualization/engine/scatter3drenderer.cpp46
-rw-r--r--src/datavisualization/engine/scatter3drenderer_p.h88
-rw-r--r--src/datavisualization/engine/scatterseriesrendercache.cpp34
-rw-r--r--src/datavisualization/engine/scatterseriesrendercache_p.h36
-rw-r--r--src/datavisualization/engine/selectionpointer.cpp40
-rw-r--r--src/datavisualization/engine/selectionpointer_p.h34
-rw-r--r--src/datavisualization/engine/seriesrendercache.cpp34
-rw-r--r--src/datavisualization/engine/seriesrendercache_p.h34
-rw-r--r--src/datavisualization/engine/surface3dcontroller.cpp36
-rw-r--r--src/datavisualization/engine/surface3dcontroller_p.h64
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp36
-rw-r--r--src/datavisualization/engine/surface3drenderer_p.h78
-rw-r--r--src/datavisualization/engine/surfaceseriesrendercache.cpp38
-rw-r--r--src/datavisualization/engine/surfaceseriesrendercache_p.h38
58 files changed, 701 insertions, 1993 deletions
diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp
index 40cbe88d..f7d7f206 100644
--- a/src/datavisualization/engine/abstract3dcontroller.cpp
+++ b/src/datavisualization/engine/abstract3dcontroller.cpp
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** 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
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
+
+#include "abstractdeclarativeinterface_p.h"
#include "abstract3dcontroller_p.h"
#include "qabstract3daxis_p.h"
#include "qvalue3daxis_p.h"
@@ -41,7 +18,7 @@
#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtCore/QMutexLocker>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
Abstract3DController::Abstract3DController(QRect initialViewport, Q3DScene *scene,
QObject *parent) :
@@ -178,6 +155,11 @@ void Abstract3DController::removeSeries(QAbstract3DSeries *series)
}
}
+bool Abstract3DController::hasSeries(QAbstract3DSeries *series)
+{
+ return m_seriesList.contains(series);
+}
+
QList<QAbstract3DSeries *> Abstract3DController::seriesList()
{
return m_seriesList;
@@ -692,12 +674,16 @@ void Abstract3DController::handleThemeTypeChanged(Q3DTheme::Theme theme)
{
Q_UNUSED(theme);
+ if (!m_qml)
+ return;
+
// Changing theme type is logically equivalent of changing the entire theme
// object, so reset all attached series to the new theme.
-
+ bool force = m_qml->isReady();
Q3DTheme *activeTheme = m_themeManager->activeTheme();
for (int i = 0; i < m_seriesList.size(); i++)
- m_seriesList.at(i)->d_ptr->resetToTheme(*activeTheme, i, true);
+ m_seriesList.at(i)->d_ptr->resetToTheme(*activeTheme, i, force);
+
markSeriesVisualsDirty();
}
@@ -1012,7 +998,7 @@ int Abstract3DController::addCustomItem(QCustom3DItem *item)
item->d_ptr->resetDirtyBits();
m_isCustomDataDirty = true;
emitNeedRender();
- return m_customItems.count() - 1;
+ return m_customItems.size() - 1;
}
void Abstract3DController::deleteCustomItems()
@@ -1539,7 +1525,7 @@ int Abstract3DController::selectedLabelIndex() const
{
int index = m_selectedLabelIndex;
QAbstract3DAxis *axis = selectedAxis();
- if (axis && axis->labels().count() <= index)
+ if (axis && axis->labels().size() <= index)
index = -1;
return index;
}
@@ -1569,7 +1555,7 @@ QAbstract3DAxis *Abstract3DController::selectedAxis() const
int Abstract3DController::selectedCustomItemIndex() const
{
int index = m_selectedCustomItemIndex;
- if (m_customItems.count() <= index)
+ if (m_customItems.size() <= index)
index = -1;
return index;
}
@@ -1608,7 +1594,7 @@ bool Abstract3DController::isOrthoProjection() const
void Abstract3DController::setAspectRatio(qreal ratio)
{
- if (m_aspectRatio != ratio) {
+ if (m_aspectRatio != ratio && ratio > 0) {
m_aspectRatio = ratio;
m_changeTracker.aspectRatioChanged = true;
emit aspectRatioChanged(m_aspectRatio);
@@ -1624,7 +1610,7 @@ qreal Abstract3DController::aspectRatio()
void Abstract3DController::setHorizontalAspectRatio(qreal ratio)
{
- if (m_horizontalAspectRatio != ratio) {
+ if (m_horizontalAspectRatio != ratio && ratio > 0) {
m_horizontalAspectRatio = ratio;
m_changeTracker.horizontalAspectRatioChanged = true;
emit horizontalAspectRatioChanged(m_horizontalAspectRatio);
@@ -1655,7 +1641,7 @@ bool Abstract3DController::reflection() const
void Abstract3DController::setReflectivity(qreal reflectivity)
{
- if (m_reflectivity != reflectivity) {
+ if (m_reflectivity != reflectivity && reflectivity > 0) {
m_reflectivity = reflectivity;
m_changeTracker.reflectivityChanged = true;
emit reflectivityChanged(m_reflectivity);
@@ -1744,4 +1730,4 @@ qreal Abstract3DController::margin() const
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/abstract3dcontroller_p.h b/src/datavisualization/engine/abstract3dcontroller_p.h
index 48a71dd9..5081d37f 100644
--- a/src/datavisualization/engine/abstract3dcontroller_p.h
+++ b/src/datavisualization/engine/abstract3dcontroller_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
@@ -40,7 +14,8 @@
#ifndef ABSTRACT3DCONTROLLER_P_H
#define ABSTRACT3DCONTROLLER_P_H
-#include "datavisualizationglobal_p.h"
+#include <private/datavisualizationglobal_p.h>
+
#include "qabstract3daxis.h"
#include "drawer_p.h"
#include "qabstract3dinputhandler.h"
@@ -54,8 +29,10 @@
QT_FORWARD_DECLARE_CLASS(QOpenGLFramebufferObject)
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
+class AbstractDeclarativeInterface;
+class AbstractDeclarative;
class Abstract3DRenderer;
class QAbstract3DSeries;
class ThemeManager;
@@ -163,7 +140,7 @@ struct Abstract3DChangeBitField {
}
};
-class QT_DATAVISUALIZATION_EXPORT Abstract3DController : public QObject
+class Q_DATAVISUALIZATION_EXPORT Abstract3DController : public QObject
{
Q_OBJECT
@@ -225,6 +202,7 @@ protected:
qreal m_margin;
QMutex m_renderMutex;
+ AbstractDeclarativeInterface *m_qml = nullptr;
explicit Abstract3DController(QRect initialViewport, Q3DScene *scene, QObject *parent = 0);
@@ -240,6 +218,7 @@ public:
virtual void addSeries(QAbstract3DSeries *series);
virtual void insertSeries(int index, QAbstract3DSeries *series);
virtual void removeSeries(QAbstract3DSeries *series);
+ virtual bool hasSeries(QAbstract3DSeries *series);
QList<QAbstract3DSeries *> seriesList();
virtual void setAxisX(QAbstract3DAxis *axis);
@@ -435,6 +414,6 @@ private:
friend class QAbstract3DGraphPrivate;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp
index ef77dc92..a39a6079 100644
--- a/src/datavisualization/engine/abstract3drenderer.cpp
+++ b/src/datavisualization/engine/abstract3drenderer.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "abstract3drenderer_p.h"
#include "texturehelper_p.h"
@@ -42,7 +18,7 @@
#include <QtGui/QOffscreenSurface>
#include <QtCore/QThread>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
// Defined in shaderhelper.cpp
extern void discardDebugMsgs(QtMsgType type, const QMessageLogContext &context, const QString &msg);
@@ -118,7 +94,7 @@ Abstract3DRenderer::Abstract3DRenderer(Abstract3DController *controller)
m_oldCameraTarget(QVector3D(2000.0f, 2000.0f, 2000.0f)), // Just random invalid target
m_reflectionEnabled(false),
m_reflectivity(0.5),
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
m_funcs_2_1(0),
#endif
m_context(0),
@@ -127,12 +103,12 @@ Abstract3DRenderer::Abstract3DRenderer(Abstract3DController *controller)
{
initializeOpenGLFunctions();
m_isOpenGLES = Utils::isOpenGLES();
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (!m_isOpenGLES) {
// Discard warnings about deprecated functions
QtMessageHandler handler = qInstallMessageHandler(discardDebugMsgs);
- m_funcs_2_1 = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_2_1>();
+ m_funcs_2_1 = new QOpenGLFunctions_2_1;
if (m_funcs_2_1)
m_funcs_2_1->initializeOpenGLFunctions();
@@ -192,6 +168,10 @@ Abstract3DRenderer::~Abstract3DRenderer()
m_axisCacheX.clearLabels();
m_axisCacheY.clearLabels();
m_axisCacheZ.clearLabels();
+
+#if !QT_CONFIG(opengles2)
+ delete m_funcs_2_1;
+#endif
}
void Abstract3DRenderer::contextCleanup()
@@ -210,7 +190,7 @@ void Abstract3DRenderer::initializeOpenGL()
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (!m_isOpenGLES) {
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
@@ -745,8 +725,10 @@ void Abstract3DRenderer::updateCustomData(const QList<QCustom3DItem *> &customIt
CustomRenderItem *renderItem = m_customRenderCache.value(item);
if (!renderItem)
renderItem = addCustomItem(item);
- renderItem->setValid(true);
- renderItem->setIndex(i); // always update index, as it must match the custom item index
+ if (renderItem) {
+ renderItem->setValid(true);
+ renderItem->setIndex(i); // always update index, as it must match the custom item index
+ }
}
// Check render item cache and remove items that are not in customItems list anymore
@@ -937,12 +919,27 @@ void Abstract3DRenderer::drawAxisTitleX(const QVector3D &labelRotation,
xRotation = -90.0f - labelRotation.z();
extraRotation = -extraRotation;
}
+ if (m_yFlipped) {
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ if (m_xFlipped)
+ xRotation = 90.0f + labelRotation.z();
+ else
+ xRotation = 90.0f - labelRotation.z();
+ }
} else {
if (m_xFlipped) {
offsetRotation = -offsetRotation;
xRotation = -90.0f - labelRotation.z();
extraRotation = -extraRotation;
}
+ if (m_yFlipped) {
+ xRotation = 90.0f + labelRotation.z();
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ if (m_xFlipped)
+ xRotation = 90.0f - labelRotation.z();
+ }
}
}
@@ -1034,6 +1031,11 @@ void Abstract3DRenderer::drawAxisTitleZ(const QVector3D &labelRotation,
yRotation = -yRotation;
}
}
+ if (m_yFlipped) {
+ xRotation = -xRotation;
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ }
}
float offsetRotation = zRotation;
@@ -1129,7 +1131,10 @@ CustomRenderItem *Abstract3DRenderer::addCustomItem(QCustom3DItem *item)
CustomRenderItem *newItem = new CustomRenderItem();
newItem->setRenderer(this);
newItem->setItemPointer(item); // Store pointer for render item updates
- newItem->setMesh(item->meshFile());
+ if (!newItem->setMesh(item->meshFile())) {
+ delete newItem;
+ return nullptr;
+ }
newItem->setOrigPosition(item->position());
newItem->setOrigScaling(item->scaling());
newItem->setScalingAbsolute(item->isScalingAbsolute());
@@ -1442,7 +1447,7 @@ void Abstract3DRenderer::drawCustomItems(RenderingState state,
bool volumeDetected = false;
int loopCount = 0;
while (loopCount < 2) {
- for (QCustom3DItem *customItem : qAsConst(m_customItemDrawOrder)) {
+ for (QCustom3DItem *customItem : std::as_const(m_customItemDrawOrder)) {
CustomRenderItem *item = m_customRenderCache.value(customItem);
// Check that the render item is visible, and skip drawing if not
// Also check if reflected item is on the "wrong" side, and skip drawing if it is
@@ -1633,7 +1638,7 @@ void Abstract3DRenderer::drawCustomItems(RenderingState state,
m_drawer->drawObject(shader, item->mesh(), item->texture());
}
}
- } else if (RenderingSelection == state) {
+ } else if (RenderingSelection == state && !volumeDetected) {
// Selection render
shader->setUniformValue(shader->MVP(), MVPMatrix);
QVector4D itemColor = indexToSelectionColor(item->index());
@@ -1991,4 +1996,4 @@ void Abstract3DRenderer::updateCameraViewport()
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/abstract3drenderer_p.h b/src/datavisualization/engine/abstract3drenderer_p.h
index affd0d69..560e6d2e 100644
--- a/src/datavisualization/engine/abstract3drenderer_p.h
+++ b/src/datavisualization/engine/abstract3drenderer_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
@@ -41,8 +15,8 @@
#define ABSTRACT3DRENDERER_P_H
#include <QtGui/QOpenGLFunctions>
-#if !defined(QT_OPENGL_ES_2)
-# include <QtGui/QOpenGLFunctions_2_1>
+#if !QT_CONFIG(opengles2)
+# include <QtOpenGL/QOpenGLFunctions_2_1>
#endif
#include "datavisualizationglobal_p.h"
#include "abstract3dcontroller_p.h"
@@ -50,9 +24,11 @@
#include "seriesrendercache_p.h"
#include "customrenderitem_p.h"
+#include <QtCore/qpointer.h>
+
QT_FORWARD_DECLARE_CLASS(QOffscreenSurface)
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class TextureHelper;
class Theme;
@@ -333,8 +309,8 @@ protected:
qreal m_reflectivity;
QLocale m_locale;
-#if !defined(QT_OPENGL_ES_2)
- QOpenGLFunctions_2_1 *m_funcs_2_1; // Not owned
+#if !QT_CONFIG(opengles2)
+ QOpenGLFunctions_2_1 *m_funcs_2_1;
#endif
QPointer<QOpenGLContext> m_context; // Not owned
bool m_isOpenGLES;
@@ -343,6 +319,6 @@ private:
friend class Abstract3DController;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/abstractdeclarativeinterface.cpp b/src/datavisualization/engine/abstractdeclarativeinterface.cpp
new file mode 100644
index 00000000..8a8b80fd
--- /dev/null
+++ b/src/datavisualization/engine/abstractdeclarativeinterface.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QtDataVisualization/private/abstractdeclarativeinterface_p.h>
+
+QT_BEGIN_NAMESPACE
+
+AbstractDeclarativeInterface::~AbstractDeclarativeInterface()
+ = default;
+
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/abstractdeclarativeinterface_p.h b/src/datavisualization/engine/abstractdeclarativeinterface_p.h
new file mode 100644
index 00000000..8ea01bb1
--- /dev/null
+++ b/src/datavisualization/engine/abstractdeclarativeinterface_p.h
@@ -0,0 +1,31 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef ABSTRACTDECLARATIVEINTERFACE_P_H
+#define ABSTRACTDECLARATIVEINTERFACE_P_H
+
+#include <QtDataVisualization/qdatavisualizationglobal.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the QtDataVisualization API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+
+QT_BEGIN_NAMESPACE
+
+class Q_DATAVISUALIZATION_EXPORT AbstractDeclarativeInterface
+{
+protected:
+ ~AbstractDeclarativeInterface();
+public:
+ virtual bool isReady() const = 0;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/datavisualization/engine/axisrendercache.cpp b/src/datavisualization/engine/axisrendercache.cpp
index cdf6c7ac..1218eec2 100644
--- a/src/datavisualization/engine/axisrendercache.cpp
+++ b/src/datavisualization/engine/axisrendercache.cpp
@@ -1,37 +1,13 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "axisrendercache_p.h"
#include <QtGui/QFontMetrics>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
AxisRenderCache::AxisRenderCache()
: m_type(QAbstract3DAxis::AxisTypeNone),
@@ -208,4 +184,4 @@ int AxisRenderCache::maxLabelWidth(const QStringList &labels) const
return labelWidth;
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/axisrendercache_p.h b/src/datavisualization/engine/axisrendercache_p.h
index bf2e3f70..a8913f1d 100644
--- a/src/datavisualization/engine/axisrendercache_p.h
+++ b/src/datavisualization/engine/axisrendercache_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
@@ -44,7 +18,7 @@
#include "drawer_p.h"
#include <QtCore/QPointer>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class AxisRenderCache : public QObject
{
@@ -154,6 +128,6 @@ private:
Q_DISABLE_COPY(AxisRenderCache)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/bars3dcontroller.cpp b/src/datavisualization/engine/bars3dcontroller.cpp
index a6bfd080..a307f2f4 100644
--- a/src/datavisualization/engine/bars3dcontroller.cpp
+++ b/src/datavisualization/engine/bars3dcontroller.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "bars3dcontroller_p.h"
#include "bars3drenderer_p.h"
@@ -37,7 +13,7 @@
#include "q3dtheme_p.h"
#include <QtCore/QMutexLocker>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
Bars3DController::Bars3DController(QRect boundRect, Q3DScene *scene)
: Abstract3DController(boundRect, scene),
@@ -49,6 +25,7 @@ Bars3DController::Bars3DController(QRect boundRect, Q3DScene *scene)
m_barThicknessRatio(1.0f),
m_barSpacing(QSizeF(1.0, 1.0)),
m_floorLevel(0.0f),
+ m_barSeriesMargin(0.0f, 0.0f),
m_renderer(0)
{
// Setting a null axis creates a new default axis according to orientation and graph type.
@@ -108,6 +85,11 @@ void Bars3DController::synchDataToRenderer()
m_changeTracker.floorLevelChanged = false;
}
+ if (m_changeTracker.barSeriesMarginChanged) {
+ m_renderer->updateBarSeriesMargin(m_barSeriesMargin);
+ m_changeTracker.barSeriesMarginChanged = false;
+ }
+
Abstract3DController::synchDataToRenderer();
// Notify changes to renderer
@@ -322,6 +304,11 @@ void Bars3DController::handleDataColumnLabelsChanged()
}
}
+void Bars3DController::handleRowColorsChanged()
+{
+ emitNeedRender();
+}
+
void Bars3DController::handleAxisAutoAdjustRangeChangedInOrientation(
QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust)
{
@@ -510,6 +497,18 @@ QSizeF Bars3DController::barSpacing()
return m_barSpacing;
}
+void Bars3DController::setBarSeriesMargin(const QSizeF &margin)
+{
+ m_barSeriesMargin = margin;
+ m_changeTracker.barSeriesMarginChanged = true;
+ emitNeedRender();
+}
+
+QSizeF Bars3DController::barSeriesMargin()
+{
+ return m_barSeriesMargin;
+}
+
bool Bars3DController::isBarSpecRelative()
{
return m_isBarSpecRelative;
@@ -730,4 +729,4 @@ QAbstract3DAxis *Bars3DController::createDefaultAxis(QAbstract3DAxis::AxisOrient
return defaultAxis;
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/bars3dcontroller_p.h b/src/datavisualization/engine/bars3dcontroller_p.h
index 74847ccd..a92db468 100644
--- a/src/datavisualization/engine/bars3dcontroller_p.h
+++ b/src/datavisualization/engine/bars3dcontroller_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
@@ -40,10 +14,10 @@
#ifndef Q3DBARSCONTROLLER_p_H
#define Q3DBARSCONTROLLER_p_H
-#include "datavisualizationglobal_p.h"
-#include "abstract3dcontroller_p.h"
+#include <private/datavisualizationglobal_p.h>
+#include <private/abstract3dcontroller_p.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Bars3DRenderer;
class QBar3DSeries;
@@ -55,6 +29,7 @@ struct Bars3DChangeBitField {
bool rowsChanged : 1;
bool itemChanged : 1;
bool floorLevelChanged : 1;
+ bool barSeriesMarginChanged : 1;
Bars3DChangeBitField() :
multiSeriesScalingChanged(true),
@@ -62,12 +37,13 @@ struct Bars3DChangeBitField {
selectedBarChanged(true),
rowsChanged(false),
itemChanged(false),
- floorLevelChanged(false)
+ floorLevelChanged(false),
+ barSeriesMarginChanged(false)
{
}
};
-class QT_DATAVISUALIZATION_EXPORT Bars3DController : public Abstract3DController
+class Q_DATAVISUALIZATION_EXPORT Bars3DController : public Abstract3DController
{
Q_OBJECT
@@ -98,6 +74,7 @@ private:
GLfloat m_barThicknessRatio;
QSizeF m_barSpacing;
float m_floorLevel;
+ QSizeF m_barSeriesMargin;
// Rendering
Bars3DRenderer *m_renderer;
@@ -106,8 +83,8 @@ public:
explicit Bars3DController(QRect rect, Q3DScene *scene = 0);
~Bars3DController();
- virtual void initializeOpenGL();
- virtual void synchDataToRenderer();
+ void initializeOpenGL() override;
+ void synchDataToRenderer() override;
void setMultiSeriesScaling(bool uniform);
bool multiSeriesScaling() const;
@@ -118,6 +95,9 @@ public:
void setBarSpecs(GLfloat thicknessRatio = 1.0f,
const QSizeF &spacing = QSizeF(1.0, 1.0),
bool relative = true);
+ void setBarSeriesMargin(const QSizeF &margin);
+ QSizeF barSeriesMargin();
+
GLfloat barThickness();
QSizeF barSpacing();
bool isBarSpecRelative();
@@ -126,29 +106,29 @@ public:
inline QBar3DSeries *selectedSeries() const { return m_selectedBarSeries; }
- void setSelectionMode(QAbstract3DGraph::SelectionFlags mode);
+ void setSelectionMode(QAbstract3DGraph::SelectionFlags mode) override;
void setSelectedBar(const QPoint &position, QBar3DSeries *series, bool enterSlice);
- virtual void clearSelection();
+ void clearSelection() override;
- virtual void handleAxisAutoAdjustRangeChangedInOrientation(
- QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust);
- virtual void handleSeriesVisibilityChangedBySender(QObject *sender);
- virtual void handlePendingClick();
+ void handleAxisAutoAdjustRangeChangedInOrientation(
+ QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust) override;
+ void handleSeriesVisibilityChangedBySender(QObject *sender) override;
+ void handlePendingClick() override;
static QPoint invalidSelectionPosition();
- virtual void setAxisX(QAbstract3DAxis *axis);
- virtual void setAxisZ(QAbstract3DAxis *axis);
+ void setAxisX(QAbstract3DAxis *axis) override;
+ void setAxisZ(QAbstract3DAxis *axis) override;
virtual void setPrimarySeries(QBar3DSeries *series);
virtual QBar3DSeries *primarySeries() const;
- virtual void addSeries(QAbstract3DSeries *series);
- virtual void removeSeries(QAbstract3DSeries *series);
- virtual void insertSeries(int index, QAbstract3DSeries *series);
+ void addSeries(QAbstract3DSeries *series) override;
+ void removeSeries(QAbstract3DSeries *series) override;
+ void insertSeries(int index, QAbstract3DSeries *series) override;
virtual QList<QBar3DSeries *> barSeriesList();
- virtual void handleAxisRangeChangedBySender(QObject *sender);
- virtual void adjustAxisRanges();
+ void handleAxisRangeChangedBySender(QObject *sender) override;
+ void adjustAxisRanges() override;
public Q_SLOTS:
void handleArrayReset();
@@ -159,13 +139,14 @@ public Q_SLOTS:
void handleItemChanged(int rowIndex, int columnIndex);
void handleDataRowLabelsChanged();
void handleDataColumnLabelsChanged();
+ void handleRowColorsChanged();
Q_SIGNALS:
void primarySeriesChanged(QBar3DSeries *series);
void selectedSeriesChanged(QBar3DSeries *series);
protected:
- virtual QAbstract3DAxis *createDefaultAxis(QAbstract3DAxis::AxisOrientation orientation);
+ QAbstract3DAxis *createDefaultAxis(QAbstract3DAxis::AxisOrientation orientation) override;
private:
void adjustSelectionPosition(QPoint &pos, const QBar3DSeries *series);
@@ -173,6 +154,6 @@ private:
Q_DISABLE_COPY(Bars3DController)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp
index bfc0f5c8..8d2d9cce 100644
--- a/src/datavisualization/engine/bars3drenderer.cpp
+++ b/src/datavisualization/engine/bars3drenderer.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "bars3drenderer_p.h"
#include "q3dcamera_p.h"
@@ -40,7 +16,7 @@
// You should see the scene from where the light is
//#define SHOW_DEPTH_TEXTURE_SCENE
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
const bool sliceGridLabels = true;
@@ -49,6 +25,7 @@ Bars3DRenderer::Bars3DRenderer(Bars3DController *controller)
m_cachedIsSlicingActivated(false),
m_cachedRowCount(0),
m_cachedColumnCount(0),
+ m_cachedBarSeriesMargin(0.0f, 0.0f),
m_selectedBar(0),
m_sliceCache(0),
m_sliceTitleItem(0),
@@ -198,7 +175,8 @@ void Bars3DRenderer::updateData()
m_seriesScaleX = 1.0f / float(m_visibleSeriesCount);
m_seriesStep = 1.0f / float(m_visibleSeriesCount);
- m_seriesStart = -((float(m_visibleSeriesCount) - 1.0f) / 2.0f) * m_seriesStep;
+ m_seriesStart = -((float(m_visibleSeriesCount) - 1.0f) / 2.0f)
+ * (m_seriesStep - (m_seriesStep * m_cachedBarSeriesMargin.width()));
if (m_keepSeriesUniform)
m_seriesScaleZ = m_seriesScaleX;
@@ -1077,7 +1055,9 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
foreach (SeriesRenderCache *baseCache, m_renderCacheList) {
if (baseCache->isVisible()) {
BarSeriesRenderCache *cache = static_cast<BarSeriesRenderCache *>(baseCache);
- float seriesPos = m_seriesStart + m_seriesStep * cache->visualIndex() + 0.5f;
+ float seriesPos = m_seriesStart + m_seriesStep
+ * (cache->visualIndex() - (cache->visualIndex()
+ * m_cachedBarSeriesMargin.width())) + 0.5f;
ObjectHelper *barObj = cache->object();
QQuaternion seriesRotation(cache->meshRotation());
const BarRenderItemArray &renderArray = cache->renderArray();
@@ -1199,7 +1179,9 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
foreach (SeriesRenderCache *baseCache, m_renderCacheList) {
if (baseCache->isVisible()) {
BarSeriesRenderCache *cache = static_cast<BarSeriesRenderCache *>(baseCache);
- float seriesPos = m_seriesStart + m_seriesStep * cache->visualIndex() + 0.5f;
+ float seriesPos = m_seriesStart + m_seriesStep
+ * (cache->visualIndex() - (cache->visualIndex()
+ * m_cachedBarSeriesMargin.width())) + 0.5f;
ObjectHelper *barObj = cache->object();
QQuaternion seriesRotation(cache->meshRotation());
const BarRenderItemArray &renderArray = cache->renderArray();
@@ -1459,7 +1441,9 @@ bool Bars3DRenderer::drawBars(BarRenderItem **selectedBar,
foreach (SeriesRenderCache *baseCache, m_renderCacheList) {
if (baseCache->isVisible()) {
BarSeriesRenderCache *cache = static_cast<BarSeriesRenderCache *>(baseCache);
- float seriesPos = m_seriesStart + m_seriesStep * cache->visualIndex() + 0.5f;
+ float seriesPos = m_seriesStart + m_seriesStep
+ * (cache->visualIndex() - (cache->visualIndex()
+ * m_cachedBarSeriesMargin.width())) + 0.5f;
ObjectHelper *barObj = cache->object();
QQuaternion seriesRotation(cache->meshRotation());
Q3DTheme::ColorStyle colorStyle = cache->colorStyle();
@@ -1620,10 +1604,17 @@ bool Bars3DRenderer::drawBars(BarRenderItem **selectedBar,
}
case Bars3DController::SelectionNone: {
// Current bar is not selected, nor on a row or column
- if (colorStyleIsUniform)
- barColor = baseColor;
- else
+ if (colorStyleIsUniform) {
+ QList<QColor> rowColors = cache->series()->rowColors();
+ if (rowColors.size() == 0) {
+ barColor = baseColor;
+ } else {
+ int rowColorIndex = row % rowColors.size();
+ barColor = Utils::vectorFromColor(rowColors[rowColorIndex]);
+ }
+ } else {
gradientTexture = cache->baseGradientTexture();
+ }
break;
}
}
@@ -2051,10 +2042,14 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer
glEnable(GL_POLYGON_OFFSET_FILL);
+ // If camera x rotation is 180, side labels face wrong direction
+ float activeCameraXRotation = (activeCamera->xRotation() >= 180.0f) ? -180.0f
+ : activeCamera->xRotation();
+
float labelAutoAngle = m_axisCacheY.labelAutoRotation();
float labelAngleFraction = labelAutoAngle / 90.0f;
float fractionCamY = activeCamera->yRotation() * labelAngleFraction;
- float fractionCamX = activeCamera->xRotation() * labelAngleFraction;
+ float fractionCamX = activeCameraXRotation * labelAngleFraction;
float labelsMaxWidth = 0.0f;
int startIndex;
@@ -2168,7 +2163,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer
labelAutoAngle = m_axisCacheZ.labelAutoRotation();
labelAngleFraction = labelAutoAngle / 90.0f;
fractionCamY = activeCamera->yRotation() * labelAngleFraction;
- fractionCamX = activeCamera->xRotation() * labelAngleFraction;
+ fractionCamX = activeCameraXRotation * labelAngleFraction;
GLfloat labelYAdjustment = 0.005f;
GLfloat colPosValue = m_scaleXWithBackground + labelMargin;
GLfloat rowPosValue = m_scaleZWithBackground + labelMargin;
@@ -2293,7 +2288,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer
labelAutoAngle = m_axisCacheX.labelAutoRotation();
labelAngleFraction = labelAutoAngle / 90.0f;
fractionCamY = activeCamera->yRotation() * labelAngleFraction;
- fractionCamX = activeCamera->xRotation() * labelAngleFraction;
+ fractionCamX = activeCameraXRotation * labelAngleFraction;
alignment = (m_xFlipped != m_zFlipped) ? Qt::AlignLeft : Qt::AlignRight;
if (labelAutoAngle == 0.0f) {
labelRotation = QVector3D(-90.0f, 90.0f, 0.0f);
@@ -2460,6 +2455,13 @@ void Bars3DRenderer::updateBarSpecs(GLfloat thicknessRatio, const QSizeF &spacin
calculateSceneScalingFactors();
}
+void Bars3DRenderer::updateBarSeriesMargin(const QSizeF &margin)
+{
+ m_cachedBarSeriesMargin = margin;
+ calculateSeriesStartPosition();
+ calculateSceneScalingFactors();
+}
+
void Bars3DRenderer::updateAxisRange(QAbstract3DAxis::AxisOrientation orientation, float min,
float max)
{
@@ -2592,6 +2594,10 @@ void Bars3DRenderer::calculateSceneScalingFactors()
m_scaleX = m_cachedBarThickness.width() / m_scaleFactor;
m_scaleZ = m_cachedBarThickness.height() / m_scaleFactor;
+ // Adjust scaling according to margin
+ m_scaleX -= m_scaleX * m_cachedBarSeriesMargin.width();
+ m_scaleZ -= m_scaleZ * m_cachedBarSeriesMargin.height();
+
// Whole graph scale factors
m_xScaleFactor = m_rowWidth / m_scaleFactor;
m_zScaleFactor = m_columnDepth / m_scaleFactor;
@@ -2655,6 +2661,12 @@ void Bars3DRenderer::calculateHeightAdjustment()
}
}
+void Bars3DRenderer::calculateSeriesStartPosition()
+{
+ m_seriesStart = -((float(m_visibleSeriesCount) - 1.0f) / 2.0f)
+ * (m_seriesStep - (m_seriesStep * m_cachedBarSeriesMargin.width()));
+}
+
Bars3DController::SelectionType Bars3DRenderer::isSelected(int row, int bar,
const BarSeriesRenderCache *cache)
{
@@ -2873,4 +2885,4 @@ void Bars3DRenderer::updateMargin(float margin)
calculateSceneScalingFactors();
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
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
diff --git a/src/datavisualization/engine/barseriesrendercache.cpp b/src/datavisualization/engine/barseriesrendercache.cpp
index 65bc7a64..da3655a9 100644
--- a/src/datavisualization/engine/barseriesrendercache.cpp
+++ b/src/datavisualization/engine/barseriesrendercache.cpp
@@ -1,35 +1,9 @@
-/****************************************************************************
-**
-** 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
#include "barseriesrendercache_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
BarSeriesRenderCache::BarSeriesRenderCache(QAbstract3DSeries *series,
Abstract3DRenderer *renderer)
@@ -50,4 +24,4 @@ void BarSeriesRenderCache::cleanup(TextureHelper *texHelper)
SeriesRenderCache::cleanup(texHelper);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/barseriesrendercache_p.h b/src/datavisualization/engine/barseriesrendercache_p.h
index 9b2ae1e1..faf963eb 100644
--- a/src/datavisualization/engine/barseriesrendercache_p.h
+++ b/src/datavisualization/engine/barseriesrendercache_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
@@ -45,7 +19,7 @@
#include "qbar3dseries_p.h"
#include "barrenderitem_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class BarSeriesRenderCache : public SeriesRenderCache
{
@@ -53,7 +27,7 @@ public:
BarSeriesRenderCache(QAbstract3DSeries *series, Abstract3DRenderer *renderer);
virtual ~BarSeriesRenderCache();
- void cleanup(TextureHelper *texHelper);
+ void cleanup(TextureHelper *texHelper) override;
inline BarRenderItemArray &renderArray() { return m_renderArray; }
inline QBar3DSeries *series() const { return static_cast<QBar3DSeries *>(m_series); }
@@ -67,6 +41,6 @@ protected:
int m_visualIndex; // order of the series is relevant
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/drawer.cpp b/src/datavisualization/engine/drawer.cpp
index 3b873ba4..63028fb4 100644
--- a/src/datavisualization/engine/drawer.cpp
+++ b/src/datavisualization/engine/drawer.cpp
@@ -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
#include "drawer_p.h"
#include "shaderhelper_p.h"
@@ -44,12 +18,13 @@ class StaticLibInitializer
public:
StaticLibInitializer()
{
- Q_INIT_RESOURCE(engine);
+ Q_INIT_RESOURCE(datavisualizationshaders);
+ Q_INIT_RESOURCE(datavisualizationmeshes);
}
};
StaticLibInitializer staticLibInitializer;
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
// Vertex array buffer for point
const GLfloat point_data[] = {0.0f, 0.0f, 0.0f};
@@ -105,7 +80,7 @@ QFont Drawer::font() const
void Drawer::drawObject(ShaderHelper *shader, AbstractObjectHelper *object, GLuint textureId,
GLuint depthTextureId, GLuint textureId3D)
{
-#if defined(QT_OPENGL_ES_2)
+#if QT_CONFIG(opengles2)
Q_UNUSED(textureId3D);
#endif
if (textureId) {
@@ -121,7 +96,7 @@ void Drawer::drawObject(ShaderHelper *shader, AbstractObjectHelper *object, GLui
glBindTexture(GL_TEXTURE_2D, depthTextureId);
shader->setUniformValue(shader->shadow(), 1);
}
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (textureId3D) {
// Activate texture
glActiveTexture(GL_TEXTURE2);
@@ -166,7 +141,7 @@ void Drawer::drawObject(ShaderHelper *shader, AbstractObjectHelper *object, GLui
glDisableVertexAttribArray(shader->posAtt());
// Release textures
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (textureId3D) {
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_3D, 0);
@@ -196,6 +171,10 @@ void Drawer::drawSelectionObject(ShaderHelper *shader, AbstractObjectHelper *obj
void Drawer::drawSurfaceGrid(ShaderHelper *shader, SurfaceObject *object)
{
+ // Get grid line color
+ QVector4D lineColor = Utils::vectorFromColor(object->wireframeColor());
+ shader->setUniformValue(shader->color(), lineColor);
+
// 1st attribute buffer : vertices
glEnableVertexAttribArray(shader->posAtt());
glBindBuffer(GL_ARRAY_BUFFER, object->vertexBuf());
@@ -451,4 +430,4 @@ void Drawer::generateLabelItem(LabelItem &item, const QString &text, int widestL
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/drawer_p.h b/src/datavisualization/engine/drawer_p.h
index 64b84eb2..54881d6d 100644
--- a/src/datavisualization/engine/drawer_p.h
+++ b/src/datavisualization/engine/drawer_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
@@ -40,13 +14,14 @@
#ifndef DRAWER_P_H
#define DRAWER_P_H
-#include "datavisualizationglobal_p.h"
-#include "q3dbars.h"
-#include "q3dtheme.h"
-#include "labelitem_p.h"
-#include "abstractrenderitem_p.h"
+#include <private/datavisualizationglobal_p.h>
+#include <private/labelitem_p.h>
+#include <private/abstractrenderitem_p.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+#include <QtDataVisualization/q3dbars.h>
+#include <QtDataVisualization/q3dtheme.h>
+
+QT_BEGIN_NAMESPACE
class ShaderHelper;
class ObjectHelper;
@@ -115,6 +90,6 @@ private:
GLfloat m_scaledFontSize;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/engine.pri b/src/datavisualization/engine/engine.pri
deleted file mode 100644
index 60703e96..00000000
--- a/src/datavisualization/engine/engine.pri
+++ /dev/null
@@ -1,61 +0,0 @@
-HEADERS += $$PWD/qabstract3dgraph_p.h \
- $$PWD/qabstract3dgraph.h \
- $$PWD/q3dbars.h \
- $$PWD/q3dbars_p.h \
- $$PWD/drawer_p.h \
- $$PWD/bars3dcontroller_p.h \
- $$PWD/bars3drenderer_p.h \
- $$PWD/q3dsurface.h \
- $$PWD/q3dsurface_p.h \
- $$PWD/surface3dcontroller_p.h \
- $$PWD/surface3drenderer_p.h \
- $$PWD/abstract3dcontroller_p.h \
- $$PWD/q3dscatter.h \
- $$PWD/q3dscatter_p.h \
- $$PWD/scatter3dcontroller_p.h \
- $$PWD/scatter3drenderer_p.h \
- $$PWD/axisrendercache_p.h \
- $$PWD/seriesrendercache_p.h \
- $$PWD/abstract3drenderer_p.h \
- $$PWD/selectionpointer_p.h \
- $$PWD/q3dcamera.h \
- $$PWD/q3dcamera_p.h \
- $$PWD/q3dscene.h \
- $$PWD/q3dlight.h \
- $$PWD/q3dlight_p.h \
- $$PWD/q3dobject.h \
- $$PWD/q3dobject_p.h \
- $$PWD/q3dscene_p.h \
- $$PWD/surfaceseriesrendercache_p.h \
- $$PWD/barseriesrendercache_p.h \
- $$PWD/scatterseriesrendercache_p.h
-
-SOURCES += $$PWD/qabstract3dgraph.cpp \
- $$PWD/q3dbars.cpp \
- $$PWD/drawer.cpp \
- $$PWD/bars3dcontroller.cpp \
- $$PWD/bars3drenderer.cpp \
- $$PWD/q3dsurface.cpp \
- $$PWD/surface3drenderer.cpp \
- $$PWD/surface3dcontroller.cpp \
- $$PWD/abstract3dcontroller.cpp \
- $$PWD/q3dscatter.cpp \
- $$PWD/scatter3dcontroller.cpp \
- $$PWD/scatter3drenderer.cpp \
- $$PWD/axisrendercache.cpp \
- $$PWD/seriesrendercache.cpp \
- $$PWD/abstract3drenderer.cpp \
- $$PWD/selectionpointer.cpp \
- $$PWD/q3dcamera.cpp \
- $$PWD/q3dlight.cpp \
- $$PWD/q3dobject.cpp \
- $$PWD/q3dscene.cpp \
- $$PWD/surfaceseriesrendercache.cpp \
- $$PWD/barseriesrendercache.cpp \
- $$PWD/scatterseriesrendercache.cpp
-
-RESOURCES += engine/engine.qrc
-
-OTHER_FILES += $$PWD/meshes/* $$PWD/shaders/*
-
-INCLUDEPATH += $$PWD
diff --git a/src/datavisualization/engine/engine.qrc b/src/datavisualization/engine/engine.qrc
deleted file mode 100644
index 0ef169c9..00000000
--- a/src/datavisualization/engine/engine.qrc
+++ /dev/null
@@ -1,74 +0,0 @@
-<RCC>
- <qresource prefix="/defaultMeshes">
- <file alias="cone">meshes/coneFlat.obj</file>
- <file alias="coneSmooth">meshes/coneSmooth.obj</file>
- <file alias="pyramid">meshes/pyramidFlat.obj</file>
- <file alias="pyramidSmooth">meshes/pyramidSmooth.obj</file>
- <file alias="bar">meshes/cubeFlat.obj</file>
- <file alias="barSmooth">meshes/cubeSmooth.obj</file>
- <file alias="cylinder">meshes/cylinderFlat.obj</file>
- <file alias="cylinderSmooth">meshes/cylinderSmooth.obj</file>
- <file alias="background">meshes/background.obj</file>
- <file alias="plane">meshes/plane.obj</file>
- <file alias="sphere">meshes/sphere.obj</file>
- <file alias="sphereSmooth">meshes/sphereSmooth.obj</file>
- <file alias="bevelbar">meshes/barFlat.obj</file>
- <file alias="bevelbarSmooth">meshes/barSmooth.obj</file>
- <file alias="coneFull">meshes/coneFilledFlat.obj</file>
- <file alias="coneSmoothFull">meshes/coneFilledSmooth.obj</file>
- <file alias="cylinderFull">meshes/cylinderFilledFlat.obj</file>
- <file alias="cylinderSmoothFull">meshes/cylinderFilledSmooth.obj</file>
- <file alias="pyramidFull">meshes/pyramidFilledFlat.obj</file>
- <file alias="pyramidSmoothFull">meshes/pyramidFilledSmooth.obj</file>
- <file alias="bevelbarFull">meshes/barFilledFlat.obj</file>
- <file alias="bevelbarSmoothFull">meshes/barFilledSmooth.obj</file>
- <file alias="barFull">meshes/cubeFilledFlat.obj</file>
- <file alias="barSmoothFull">meshes/cubeFilledSmooth.obj</file>
- <file alias="backgroundNoFloor">meshes/backgroundNoFloor.obj</file>
- <file alias="minimal">meshes/minimalFlat.obj</file>
- <file alias="minimalSmooth">meshes/minimalSmooth.obj</file>
- <file alias="arrow">meshes/arrowFlat.obj</file>
- <file alias="arrowSmooth">meshes/arrowSmooth.obj</file>
- </qresource>
- <qresource prefix="/shaders">
- <file alias="fragment">shaders/default.frag</file>
- <file alias="vertex">shaders/default.vert</file>
- <file alias="fragmentColorOnY">shaders/colorOnY.frag</file>
- <file alias="fragmentPlainColor">shaders/plainColor.frag</file>
- <file alias="vertexPlainColor">shaders/plainColor.vert</file>
- <file alias="fragmentLabel">shaders/label.frag</file>
- <file alias="vertexLabel">shaders/label.vert</file>
- <file alias="fragmentDepth">shaders/depth.frag</file>
- <file alias="vertexDepth">shaders/depth.vert</file>
- <file alias="fragmentShadow">shaders/shadow.frag</file>
- <file alias="vertexShadow">shaders/shadow.vert</file>
- <file alias="fragmentShadowNoTex">shaders/shadowNoTex.frag</file>
- <file alias="fragmentShadowNoTexColorOnY">shaders/shadowNoTexColorOnY.frag</file>
- <file alias="fragmentColorOnYES2">shaders/colorOnY_ES2.frag</file>
- <file alias="fragmentES2">shaders/default_ES2.frag</file>
- <file alias="fragmentSurface">shaders/surface.frag</file>
- <file alias="vertexSurfaceFlat">shaders/surfaceFlat.vert</file>
- <file alias="fragmentSurfaceFlat">shaders/surfaceFlat.frag</file>
- <file alias="fragmentSurfaceES2">shaders/surface_ES2.frag</file>
- <file alias="vertexPointES2">shaders/point_ES2.vert</file>
- <file alias="fragmentSurfaceShadowNoTex">shaders/surfaceShadowNoTex.frag</file>
- <file alias="fragmentSurfaceShadowFlat">shaders/surfaceShadowFlat.frag</file>
- <file alias="vertexSurfaceShadowFlat">shaders/surfaceShadowFlat.vert</file>
- <file alias="fragmentTexture">shaders/texture.frag</file>
- <file alias="fragmentTextureES2">shaders/texture_ES2.frag</file>
- <file alias="vertexTexture">shaders/texture.vert</file>
- <file alias="fragmentTexturedSurfaceShadowFlat">shaders/surfaceTexturedShadowFlat.frag</file>
- <file alias="fragmentSurfaceTexturedFlat">shaders/surfaceTexturedFlat.frag</file>
- <file alias="fragmentTexture3D">shaders/texture3d.frag</file>
- <file alias="vertexTexture3D">shaders/texture3d.vert</file>
- <file alias="fragmentTexture3DSlice">shaders/texture3dslice.frag</file>
- <file alias="vertexShadowNoMatrices">shaders/shadowNoMatrices.vert</file>
- <file alias="vertexNoMatrices">shaders/defaultNoMatrices.vert</file>
- <file alias="fragmentTexture3DLowDef">shaders/texture3dlowdef.frag</file>
- <file alias="vertexPointES2_UV">shaders/point_ES2_UV.vert</file>
- <file alias="fragment3DSliceFrames">shaders/3dsliceframes.frag</file>
- <file alias="vertexPosition">shaders/position.vert</file>
- <file alias="fragmentPositionMap">shaders/positionmap.frag</file>
- <file alias="fragmentTexturedSurfaceShadow">shaders/surfaceTexturedShadow.frag</file>
- </qresource>
-</RCC>
diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp
index 2f2cf63b..a5204b24 100644
--- a/src/datavisualization/engine/q3dbars.cpp
+++ b/src/datavisualization/engine/q3dbars.cpp
@@ -1,35 +1,9 @@
-/****************************************************************************
-**
-** 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
#include "q3dbars_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DBars
@@ -88,7 +62,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*
* The scene can be rotated, zoomed into, and a bar can be selected to view its value,
* but no other interaction is included in this minimal code example. You can learn more by
- * familiarizing yourself with the examples provided, like the \l{Bars Example}.
+ * familiarizing yourself with the examples provided, like the \l{Bar Graph}.
*
* \sa Q3DScatter, Q3DSurface, {Qt Data Visualization C++ Classes}
*/
@@ -157,7 +131,7 @@ QBar3DSeries *Q3DBars::primarySeries() const
* to the axes. If the newly added series has specified a selected bar, it will be highlighted and
* any existing selection will be cleared. Only one added series can have an active selection.
*
- * \sa seriesList(), primarySeries
+ * \sa seriesList(), primarySeries, QAbstract3DGraph::hasSeries()
*/
void Q3DBars::addSeries(QBar3DSeries *series)
{
@@ -166,6 +140,8 @@ void Q3DBars::addSeries(QBar3DSeries *series)
/*!
* Removes the \a series from the graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
void Q3DBars::removeSeries(QBar3DSeries *series)
{
@@ -180,7 +156,7 @@ void Q3DBars::removeSeries(QBar3DSeries *series)
* the new position in list is calculated as if the series was still in its old
* index, so the final index is actually the \a index decremented by one.
*
- * \sa addSeries(), seriesList()
+ * \sa addSeries(), seriesList(), QAbstract3DGraph::hasSeries()
*/
void Q3DBars::insertSeries(int index, QBar3DSeries *series)
{
@@ -189,6 +165,8 @@ void Q3DBars::insertSeries(int index, QBar3DSeries *series)
/*!
* Returns the list of series added to this graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
QList<QBar3DSeries *> Q3DBars::seriesList() const
{
@@ -247,7 +225,7 @@ float Q3DBars::barThickness() const
* Preset to \c {(1.0, 1.0)} by default. Spacing is affected by the
* barSpacingRelative property.
*
- * \sa barSpacingRelative, multiSeriesUniform
+ * \sa barSpacingRelative, multiSeriesUniform, barSeriesMargin
*/
void Q3DBars::setBarSpacing(const QSizeF &spacing)
{
@@ -285,6 +263,31 @@ bool Q3DBars::isBarSpacingRelative() const
}
/*!
+ * \property Q3DBars::barSeriesMargin
+ * \since 6.3
+ *
+ * \brief Margin between series columns in X and Z dimensions.
+ * Sensible values are on the range [0,1).
+ *
+ * Preset to \c {(0.0, 0.0)} by default. This property enables
+ * showing bars from different series side by side, but with space between columns.
+ *
+ * \sa barSpacing
+ */
+void Q3DBars::setBarSeriesMargin(const QSizeF &margin)
+{
+ if (margin != barSeriesMargin()) {
+ dptr()->m_shared->setBarSeriesMargin(margin);
+ emit barSeriesMarginChanged(margin);
+ }
+}
+
+QSizeF Q3DBars::barSeriesMargin() const
+{
+ return dptrc()->m_shared->barSeriesMargin();
+}
+
+/*!
* \property Q3DBars::rowAxis
*
* \brief The axis attached to the active row.
@@ -469,4 +472,4 @@ Q3DBars *Q3DBarsPrivate::qptr()
return static_cast<Q3DBars *>(q_ptr);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dbars.h b/src/datavisualization/engine/q3dbars.h
index 6bbe7600..75d9b15f 100644
--- a/src/datavisualization/engine/q3dbars.h
+++ b/src/datavisualization/engine/q3dbars.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
#ifndef Q3DBARS_H
#define Q3DBARS_H
@@ -35,17 +9,18 @@
#include <QtDataVisualization/qcategory3daxis.h>
#include <QtDataVisualization/qbar3dseries.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DBarsPrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DBars : public QAbstract3DGraph
+class Q_DATAVISUALIZATION_EXPORT Q3DBars : public QAbstract3DGraph
{
Q_OBJECT
Q_PROPERTY(bool multiSeriesUniform READ isMultiSeriesUniform WRITE setMultiSeriesUniform NOTIFY multiSeriesUniformChanged)
Q_PROPERTY(float barThickness READ barThickness WRITE setBarThickness NOTIFY barThicknessChanged)
Q_PROPERTY(QSizeF barSpacing READ barSpacing WRITE setBarSpacing NOTIFY barSpacingChanged)
Q_PROPERTY(bool barSpacingRelative READ isBarSpacingRelative WRITE setBarSpacingRelative NOTIFY barSpacingRelativeChanged)
+ Q_PROPERTY(QSizeF barSeriesMargin READ barSeriesMargin WRITE setBarSeriesMargin NOTIFY barSeriesMarginChanged REVISION(6, 3))
Q_PROPERTY(QCategory3DAxis *rowAxis READ rowAxis WRITE setRowAxis NOTIFY rowAxisChanged)
Q_PROPERTY(QCategory3DAxis *columnAxis READ columnAxis WRITE setColumnAxis NOTIFY columnAxisChanged)
Q_PROPERTY(QValue3DAxis *valueAxis READ valueAxis WRITE setValueAxis NOTIFY valueAxisChanged)
@@ -76,6 +51,9 @@ public:
void setBarSpacingRelative(bool relative);
bool isBarSpacingRelative() const;
+ void setBarSeriesMargin(const QSizeF &margin);
+ QSizeF barSeriesMargin() const;
+
void setRowAxis(QCategory3DAxis *axis);
QCategory3DAxis *rowAxis() const;
void setColumnAxis(QCategory3DAxis *axis);
@@ -95,6 +73,7 @@ Q_SIGNALS:
void barThicknessChanged(float thicknessRatio);
void barSpacingChanged(const QSizeF &spacing);
void barSpacingRelativeChanged(bool relative);
+ Q_REVISION(6, 3) void barSeriesMarginChanged(const QSizeF &margin);
void rowAxisChanged(QCategory3DAxis *axis);
void columnAxisChanged(QCategory3DAxis *axis);
void valueAxisChanged(QValue3DAxis *axis);
@@ -108,6 +87,6 @@ private:
Q_DISABLE_COPY(Q3DBars)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dbars_p.h b/src/datavisualization/engine/q3dbars_p.h
index de581071..cd2a2ac1 100644
--- a/src/datavisualization/engine/q3dbars_p.h
+++ b/src/datavisualization/engine/q3dbars_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
@@ -43,7 +17,7 @@
#include "bars3dcontroller_p.h"
#include "qabstract3dgraph_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DBars;
@@ -54,15 +28,15 @@ public:
Q3DBarsPrivate(Q3DBars *q);
~Q3DBarsPrivate();
- void handleAxisXChanged(QAbstract3DAxis *axis);
- void handleAxisYChanged(QAbstract3DAxis *axis);
- void handleAxisZChanged(QAbstract3DAxis *axis);
+ void handleAxisXChanged(QAbstract3DAxis *axis) override;
+ void handleAxisYChanged(QAbstract3DAxis *axis) override;
+ void handleAxisZChanged(QAbstract3DAxis *axis) override;
Q3DBars *qptr();
Bars3DController *m_shared;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dcamera.cpp b/src/datavisualization/engine/q3dcamera.cpp
index 5b359a4e..69839fdc 100644
--- a/src/datavisualization/engine/q3dcamera.cpp
+++ b/src/datavisualization/engine/q3dcamera.cpp
@@ -1,38 +1,12 @@
-/****************************************************************************
-**
-** 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
#include "q3dcamera_p.h"
#include "utils_p.h"
#include <QtCore/qmath.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DCamera
@@ -939,4 +913,4 @@ QVector3D Q3DCameraPrivate::calculatePositionRelativeToCamera(const QVector3D &r
zPos + relativePosition.z());
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dcamera.h b/src/datavisualization/engine/q3dcamera.h
index 9ef4a1b8..1c59bc13 100644
--- a/src/datavisualization/engine/q3dcamera.h
+++ b/src/datavisualization/engine/q3dcamera.h
@@ -1,42 +1,16 @@
-/****************************************************************************
-**
-** 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
#ifndef Q3DCAMERA_H
#define Q3DCAMERA_H
#include <QtDataVisualization/q3dobject.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DCameraPrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DCamera : public Q3DObject
+class Q_DATAVISUALIZATION_EXPORT Q3DCamera : public Q3DObject
{
Q_OBJECT
Q_ENUMS(CameraPreset)
@@ -46,9 +20,9 @@ class QT_DATAVISUALIZATION_EXPORT Q3DCamera : public Q3DObject
Q_PROPERTY(CameraPreset cameraPreset READ cameraPreset WRITE setCameraPreset NOTIFY cameraPresetChanged)
Q_PROPERTY(bool wrapXRotation READ wrapXRotation WRITE setWrapXRotation NOTIFY wrapXRotationChanged)
Q_PROPERTY(bool wrapYRotation READ wrapYRotation WRITE setWrapYRotation NOTIFY wrapYRotationChanged)
- Q_PROPERTY(QVector3D target READ target WRITE setTarget NOTIFY targetChanged REVISION 1)
- Q_PROPERTY(float minZoomLevel READ minZoomLevel WRITE setMinZoomLevel NOTIFY minZoomLevelChanged REVISION 1)
- Q_PROPERTY(float maxZoomLevel READ maxZoomLevel WRITE setMaxZoomLevel NOTIFY maxZoomLevelChanged REVISION 1)
+ Q_PROPERTY(QVector3D target READ target WRITE setTarget NOTIFY targetChanged REVISION(1, 2))
+ Q_PROPERTY(float minZoomLevel READ minZoomLevel WRITE setMinZoomLevel NOTIFY minZoomLevelChanged REVISION(1, 2))
+ Q_PROPERTY(float maxZoomLevel READ maxZoomLevel WRITE setMaxZoomLevel NOTIFY maxZoomLevelChanged REVISION(1, 2))
public:
enum CameraPreset {
@@ -93,7 +67,7 @@ public:
bool wrapYRotation() const;
void setWrapYRotation(bool isEnabled);
- virtual void copyValuesFrom(const Q3DObject &source);
+ void copyValuesFrom(const Q3DObject &source) override;
CameraPreset cameraPreset() const;
void setCameraPreset(CameraPreset preset);
@@ -117,9 +91,9 @@ Q_SIGNALS:
void cameraPresetChanged(Q3DCamera::CameraPreset preset);
void wrapXRotationChanged(bool isEnabled);
void wrapYRotationChanged(bool isEnabled);
- Q_REVISION(1) void targetChanged(const QVector3D &target);
- Q_REVISION(1) void minZoomLevelChanged(float zoomLevel);
- Q_REVISION(1) void maxZoomLevelChanged(float zoomLevel);
+ Q_REVISION(1, 2) void targetChanged(const QVector3D &target);
+ Q_REVISION(1, 2) void minZoomLevelChanged(float zoomLevel);
+ Q_REVISION(1, 2) void maxZoomLevelChanged(float zoomLevel);
private:
QScopedPointer<Q3DCameraPrivate> d_ptr;
@@ -137,6 +111,6 @@ private:
friend class QTouch3DInputHandlerPrivate;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dcamera_p.h b/src/datavisualization/engine/q3dcamera_p.h
index 8c45d483..dac62870 100644
--- a/src/datavisualization/engine/q3dcamera_p.h
+++ b/src/datavisualization/engine/q3dcamera_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
@@ -44,7 +18,7 @@
#include "q3dcamera.h"
#include <QtGui/QMatrix4x4>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DCamera;
@@ -89,7 +63,7 @@ Q_SIGNALS:
void minYRotationChanged(float rotation);
void maxXRotationChanged(float rotation);
void maxYRotationChanged(float rotation);
- void viewMatrixChanged(QMatrix4x4 viewMatrix);
+ void viewMatrixChanged(const QMatrix4x4 &viewMatrix);
void viewMatrixAutoUpdateChanged(bool enabled);
public:
@@ -123,6 +97,6 @@ public:
friend class QTouch3DInputHandler;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dlight.cpp b/src/datavisualization/engine/q3dlight.cpp
index bce35d99..86afbe01 100644
--- a/src/datavisualization/engine/q3dlight.cpp
+++ b/src/datavisualization/engine/q3dlight.cpp
@@ -1,35 +1,9 @@
-/****************************************************************************
-**
-** 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
#include "q3dlight_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DLight
@@ -122,4 +96,4 @@ void Q3DLightPrivate::sync(Q3DLight &other)
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dlight.h b/src/datavisualization/engine/q3dlight.h
index 546ac424..ceae12bf 100644
--- a/src/datavisualization/engine/q3dlight.h
+++ b/src/datavisualization/engine/q3dlight.h
@@ -1,45 +1,19 @@
-/****************************************************************************
-**
-** 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
#ifndef Q3DLIGHT_H
#define Q3DLIGHT_H
#include <QtDataVisualization/q3dobject.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DLightPrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DLight : public Q3DObject
+class Q_DATAVISUALIZATION_EXPORT Q3DLight : public Q3DObject
{
Q_OBJECT
- Q_PROPERTY(bool autoPosition READ isAutoPosition WRITE setAutoPosition NOTIFY autoPositionChanged REVISION 1)
+ Q_PROPERTY(bool autoPosition READ isAutoPosition WRITE setAutoPosition NOTIFY autoPositionChanged REVISION(1, 3))
public:
explicit Q3DLight(QObject *parent = nullptr);
@@ -49,7 +23,7 @@ public:
bool isAutoPosition();
Q_SIGNALS:
- Q_REVISION(1) void autoPositionChanged(bool autoPosition);
+ Q_REVISION(1, 3) void autoPositionChanged(bool autoPosition);
private:
QScopedPointer<Q3DLightPrivate> d_ptr;
@@ -60,6 +34,6 @@ private:
friend class Q3DScenePrivate;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dlight_p.h b/src/datavisualization/engine/q3dlight_p.h
index 6348deb9..6e1e7ff5 100644
--- a/src/datavisualization/engine/q3dlight_p.h
+++ b/src/datavisualization/engine/q3dlight_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
@@ -43,7 +17,7 @@
#include "datavisualizationglobal_p.h"
#include "q3dlight.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DScene;
class Q3DLight;
@@ -61,7 +35,7 @@ public:
bool m_automaticLight;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dobject.cpp b/src/datavisualization/engine/q3dobject.cpp
index 099fa2f0..c9e417dd 100644
--- a/src/datavisualization/engine/q3dobject.cpp
+++ b/src/datavisualization/engine/q3dobject.cpp
@@ -1,36 +1,10 @@
-/****************************************************************************
-**
-** 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
#include "q3dobject_p.h"
#include "q3dscene_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
\class Q3DObject
@@ -155,4 +129,4 @@ Q3DObjectPrivate::~Q3DObjectPrivate()
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dobject.h b/src/datavisualization/engine/q3dobject.h
index 812e89cb..875e1955 100644
--- a/src/datavisualization/engine/q3dobject.h
+++ b/src/datavisualization/engine/q3dobject.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
#ifndef Q3DOBJECT_H
#define Q3DOBJECT_H
@@ -36,12 +10,12 @@
Q_MOC_INCLUDE(<QtDataVisualization/q3dscene.h>)
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DObjectPrivate;
class Q3DScene;
-class QT_DATAVISUALIZATION_EXPORT Q3DObject : public QObject
+class Q_DATAVISUALIZATION_EXPORT Q3DObject : public QObject
{
Q_OBJECT
Q_PROPERTY(Q3DScene* parentScene READ parentScene)
@@ -73,6 +47,6 @@ private:
friend class Q3DScenePrivate;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dobject_p.h b/src/datavisualization/engine/q3dobject_p.h
index ef1f2371..9eeaaae8 100644
--- a/src/datavisualization/engine/q3dobject_p.h
+++ b/src/datavisualization/engine/q3dobject_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
@@ -42,7 +16,7 @@
#include "datavisualizationglobal_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DObject;
class Q3DScene;
@@ -59,6 +33,6 @@ public:
bool m_isDirty;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dscatter.cpp b/src/datavisualization/engine/q3dscatter.cpp
index b16b2513..07c86110 100644
--- a/src/datavisualization/engine/q3dscatter.cpp
+++ b/src/datavisualization/engine/q3dscatter.cpp
@@ -1,36 +1,12 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "q3dscatter.h"
#include "q3dscatter_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DScatter
@@ -77,7 +53,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
* The scene can be rotated, zoomed into, and an item can be selected to view its position,
* but no other interaction is included in this minimal code example.
* You can learn more by familiarizing yourself with the examples provided, like
- * the \l{Scatter Example}.
+ * the \l{Scatter Graph}.
*
* \sa Q3DBars, Q3DSurface, {Qt Data Visualization C++ Classes}
*/
@@ -110,6 +86,8 @@ Q3DScatter::~Q3DScatter()
* Adds the \a series to the graph. A graph can contain multiple series, but has only one set of
* axes. If the newly added series has specified a selected item, it will be highlighted and
* any existing selection will be cleared. Only one added series can have an active selection.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
void Q3DScatter::addSeries(QScatter3DSeries *series)
{
@@ -118,6 +96,8 @@ void Q3DScatter::addSeries(QScatter3DSeries *series)
/*!
* Removes the \a series from the graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
void Q3DScatter::removeSeries(QScatter3DSeries *series)
{
@@ -126,6 +106,8 @@ void Q3DScatter::removeSeries(QScatter3DSeries *series)
/*!
* Returns the list of series added to this graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
QList<QScatter3DSeries *> Q3DScatter::seriesList() const
{
@@ -306,5 +288,5 @@ Q3DScatter *Q3DScatterPrivate::qptr()
return static_cast<Q3DScatter *>(q_ptr);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dscatter.h b/src/datavisualization/engine/q3dscatter.h
index 9067ee0f..5396471e 100644
--- a/src/datavisualization/engine/q3dscatter.h
+++ b/src/datavisualization/engine/q3dscatter.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
#ifndef Q3DSCATTER_H
#define Q3DSCATTER_H
@@ -34,11 +8,11 @@
#include <QtDataVisualization/qvalue3daxis.h>
#include <QtDataVisualization/qscatter3dseries.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DScatterPrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DScatter : public QAbstract3DGraph
+class Q_DATAVISUALIZATION_EXPORT Q3DScatter : public QAbstract3DGraph
{
Q_OBJECT
Q_PROPERTY(QValue3DAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
@@ -78,6 +52,6 @@ private:
Q_DISABLE_COPY(Q3DScatter)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dscatter_p.h b/src/datavisualization/engine/q3dscatter_p.h
index 748fc2e9..b307a65b 100644
--- a/src/datavisualization/engine/q3dscatter_p.h
+++ b/src/datavisualization/engine/q3dscatter_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
@@ -43,7 +17,7 @@
#include "scatter3dcontroller_p.h"
#include "qabstract3dgraph_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DScatter;
@@ -54,15 +28,15 @@ public:
Q3DScatterPrivate(Q3DScatter *q);
~Q3DScatterPrivate();
- void handleAxisXChanged(QAbstract3DAxis *axis);
- void handleAxisYChanged(QAbstract3DAxis *axis);
- void handleAxisZChanged(QAbstract3DAxis *axis);
+ void handleAxisXChanged(QAbstract3DAxis *axis) override;
+ void handleAxisYChanged(QAbstract3DAxis *axis) override;
+ void handleAxisZChanged(QAbstract3DAxis *axis) override;
Q3DScatter *qptr();
Scatter3DController *m_shared;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dscene.cpp b/src/datavisualization/engine/q3dscene.cpp
index 75437c9c..143983e7 100644
--- a/src/datavisualization/engine/q3dscene.cpp
+++ b/src/datavisualization/engine/q3dscene.cpp
@@ -1,37 +1,11 @@
-/****************************************************************************
-**
-** 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
#include "q3dscene_p.h"
#include "q3dcamera_p.h"
#include "q3dlight_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DScene
@@ -832,4 +806,4 @@ bool Q3DScenePrivate::isInArea(const QRect &area, int x, int y) const
return ( x >= areaMinX && x <= areaMaxX && y >= areaMinY && y <= areaMaxY );
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dscene.h b/src/datavisualization/engine/q3dscene.h
index de71255d..dd9e68c7 100644
--- a/src/datavisualization/engine/q3dscene.h
+++ b/src/datavisualization/engine/q3dscene.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
#ifndef Q3DSCENE_H
#define Q3DSCENE_H
@@ -36,11 +10,11 @@
#include <QtCore/QObject>
#include <QtCore/QRect>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DScenePrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DScene : public QObject
+class Q_DATAVISUALIZATION_EXPORT Q3DScene : public QObject
{
Q_OBJECT
Q_PROPERTY(QRect viewport READ viewport NOTIFY viewportChanged)
@@ -52,7 +26,7 @@ class QT_DATAVISUALIZATION_EXPORT Q3DScene : public QObject
Q_PROPERTY(Q3DCamera* activeCamera READ activeCamera WRITE setActiveCamera NOTIFY activeCameraChanged)
Q_PROPERTY(Q3DLight* activeLight READ activeLight WRITE setActiveLight NOTIFY activeLightChanged)
Q_PROPERTY(float devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged)
- Q_PROPERTY(QPoint graphPositionQuery READ graphPositionQuery WRITE setGraphPositionQuery NOTIFY graphPositionQueryChanged REVISION 1)
+ Q_PROPERTY(QPoint graphPositionQuery READ graphPositionQuery WRITE setGraphPositionQuery NOTIFY graphPositionQueryChanged REVISION(1, 2))
public:
explicit Q3DScene(QObject *parent = nullptr);
@@ -100,7 +74,7 @@ Q_SIGNALS:
void activeLightChanged(Q3DLight *light);
void devicePixelRatioChanged(float pixelRatio);
void selectionQueryPositionChanged(const QPoint &position);
- Q_REVISION(1) void graphPositionQueryChanged(const QPoint &position);
+ Q_REVISION(1, 2) void graphPositionQueryChanged(const QPoint &position);
private:
QScopedPointer<Q3DScenePrivate> d_ptr;
@@ -121,6 +95,6 @@ private:
friend class Q3DObject;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dscene_p.h b/src/datavisualization/engine/q3dscene_p.h
index 4056e89d..687606cb 100644
--- a/src/datavisualization/engine/q3dscene_p.h
+++ b/src/datavisualization/engine/q3dscene_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
@@ -40,10 +14,10 @@
#ifndef Q3DSCENE_P_H
#define Q3DSCENE_P_H
-#include "datavisualizationglobal_p.h"
-#include "q3dscene.h"
+#include <private/datavisualizationglobal_p.h>
+#include <QtDataVisualization/q3dscene.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DCamera;
class Q3DLight;
@@ -77,7 +51,7 @@ struct Q3DSceneChangeBitField {
}
};
-class QT_DATAVISUALIZATION_EXPORT Q3DScenePrivate : public QObject
+class Q_DATAVISUALIZATION_EXPORT Q3DScenePrivate : public QObject
{
Q_OBJECT
public:
@@ -133,6 +107,6 @@ public:
QRect m_defaultLargeViewport;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dsurface.cpp b/src/datavisualization/engine/q3dsurface.cpp
index f3fac1c7..2b456814 100644
--- a/src/datavisualization/engine/q3dsurface.cpp
+++ b/src/datavisualization/engine/q3dsurface.cpp
@@ -1,36 +1,12 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "q3dsurface.h"
#include "q3dsurface_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class Q3DSurface
@@ -91,7 +67,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
* The scene can be rotated, zoomed into, and a surface point can be selected to view its position,
* but no other interaction is included in this minimal code example.
* You can learn more by familiarizing yourself with the examples provided,
- * like the \l{Surface Example}.
+ * like the \l{Surface Graph}.
*
*
* \sa Q3DBars, Q3DScatter, {Qt Data Visualization C++ Classes}
@@ -127,6 +103,8 @@ Q3DSurface::~Q3DSurface()
* Adds the \a series to the graph. A graph can contain multiple series, but has only one set of
* axes. If the newly added series has specified a selected item, it will be highlighted and
* any existing selection will be cleared. Only one added series can have an active selection.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
void Q3DSurface::addSeries(QSurface3DSeries *series)
{
@@ -135,6 +113,8 @@ void Q3DSurface::addSeries(QSurface3DSeries *series)
/*!
* Removes the \a series from the graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
void Q3DSurface::removeSeries(QSurface3DSeries *series)
{
@@ -143,6 +123,8 @@ void Q3DSurface::removeSeries(QSurface3DSeries *series)
/*!
* Returns the list of series added to this graph.
+ *
+ * \sa QAbstract3DGraph::hasSeries()
*/
QList<QSurface3DSeries *> Q3DSurface::seriesList() const
{
@@ -356,4 +338,4 @@ Q3DSurface *Q3DSurfacePrivate::qptr()
return static_cast<Q3DSurface *>(q_ptr);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/q3dsurface.h b/src/datavisualization/engine/q3dsurface.h
index 48a27c4f..c6f26972 100644
--- a/src/datavisualization/engine/q3dsurface.h
+++ b/src/datavisualization/engine/q3dsurface.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
#ifndef Q3DSURFACE_H
#define Q3DSURFACE_H
@@ -34,11 +8,11 @@
#include <QtDataVisualization/qvalue3daxis.h>
#include <QtDataVisualization/qsurface3dseries.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DSurfacePrivate;
-class QT_DATAVISUALIZATION_EXPORT Q3DSurface : public QAbstract3DGraph
+class Q_DATAVISUALIZATION_EXPORT Q3DSurface : public QAbstract3DGraph
{
Q_OBJECT
Q_PROPERTY(QValue3DAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
@@ -83,6 +57,6 @@ private:
Q_DISABLE_COPY(Q3DSurface)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/q3dsurface_p.h b/src/datavisualization/engine/q3dsurface_p.h
index c9c22d63..b70bb643 100644
--- a/src/datavisualization/engine/q3dsurface_p.h
+++ b/src/datavisualization/engine/q3dsurface_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
@@ -43,7 +17,7 @@
#include "surface3dcontroller_p.h"
#include "qabstract3dgraph_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Q3DSurface;
@@ -54,15 +28,15 @@ public:
Q3DSurfacePrivate(Q3DSurface *q);
~Q3DSurfacePrivate();
- void handleAxisXChanged(QAbstract3DAxis *axis);
- void handleAxisYChanged(QAbstract3DAxis *axis);
- void handleAxisZChanged(QAbstract3DAxis *axis);
+ void handleAxisXChanged(QAbstract3DAxis *axis) override;
+ void handleAxisYChanged(QAbstract3DAxis *axis) override;
+ void handleAxisZChanged(QAbstract3DAxis *axis) override;
Q3DSurface *qptr();
Surface3DController *m_shared;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp
index cb972779..3b7eca01 100644
--- a/src/datavisualization/engine/qabstract3dgraph.cpp
+++ b/src/datavisualization/engine/qabstract3dgraph.cpp
@@ -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
#include "qabstract3dgraph.h"
#include "qabstract3dgraph_p.h"
@@ -41,11 +15,11 @@
#include <QtGui/QPainter>
#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtGui/QOffscreenSurface>
-#if defined(Q_OS_OSX)
+#if defined(Q_OS_MACOS)
#include <qpa/qplatformnativeinterface.h>
#endif
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
/*!
* \class QAbstract3DGraph
@@ -60,7 +34,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
* Anti-aliasing is turned on by default on C++, except in OpenGL ES2
* environments, where anti-aliasing is not supported by Qt Data Visualization.
* To specify non-default anti-aliasing for a graph, give a custom surface format as
- * a constructor parameter. You can use the convenience function \c QtDataVisualization::qDefaultSurfaceFormat()
+ * a constructor parameter. You can use the convenience function \c qDefaultSurfaceFormat()
* to create the surface format object.
*
* \note QAbstract3DGraph sets window flag \c Qt::FramelessWindowHint on by default. If you want to display
@@ -110,6 +84,8 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
\value SelectionMultiSeries
Setting this mode means that items for all series at same position are highlighted, instead
of just the selected item. The actual selection in the other series doesn't change.
+ When setting this mode flag, one or more of the basic selection flags (\c {SelectionItem},
+ \c {SelectionRow}, or \c SelectionColumn) must also be set.
Multi-series selection is not supported for Q3DScatter.
*/
@@ -186,7 +162,7 @@ QAbstract3DGraph::QAbstract3DGraph(QAbstract3DGraphPrivate *d, const QSurfaceFor
// Make sure renderable type is correct
surfaceFormat.setRenderableType(QSurfaceFormat::DefaultRenderableType);
} else {
- surfaceFormat = qDefaultSurfaceFormat();
+ surfaceFormat = qDefaultSurfaceFormat(true);
}
d_ptr->m_context = new QOpenGLContext(this);
@@ -224,7 +200,7 @@ QAbstract3DGraph::QAbstract3DGraph(QAbstract3DGraphPrivate *d, const QSurfaceFor
d_ptr->renderLater();
-#if defined(Q_OS_OSX)
+#if defined(Q_OS_MACOS)
// Enable touch events for Mac touchpads
typedef void * (*EnableTouch)(QWindow*, bool);
EnableTouch enableTouch =
@@ -436,6 +412,16 @@ void QAbstract3DGraph::clearSelection()
}
/*!
+ * Returns whether the \a series has already been added to the graph.
+ *
+ * \since 6.3
+ */
+bool QAbstract3DGraph::hasSeries(QAbstract3DSeries *series) const
+{
+ return d_ptr->m_visualController->hasSeries(series);
+}
+
+/*!
* Adds a QCustom3DItem \a item to the graph. Graph takes ownership of the added item.
*
* Returns the index to the added item if the add operation was successful, -1
@@ -581,7 +567,7 @@ QCustom3DItem *QAbstract3DGraph::selectedCustomItem() const
* \c selectedElementChanged signal is emitted.
*
* The signal can be used for example for implementing custom input handlers, as
- * demonstrated by the \l {Axis Range Dragging With Labels Example}.
+ * demonstrated in the \l {Graph Gallery} example under \uicontrol {Scatter Graph} tab.
*
* \sa selectedLabelIndex(), selectedAxis(), selectedCustomItemIndex(), selectedCustomItem(),
* Q3DBars::selectedSeries(), Q3DScatter::selectedSeries(), Q3DSurface::selectedSeries(),
@@ -656,11 +642,6 @@ qreal QAbstract3DGraph::currentFps() const
*
* \brief Whether orthographic projection is used for displaying the graph.
*
- * If \c {true}, ortographic projection is used to create 2D graphs by replacing
- * the default input handler with one that does not allow rotating the graph and
- * by setting the camera to view the graph
- * directly from the side or from the top. Also, axis labels typically need to be rotated when
- * viewing the graph from the sides.
* Defaults to \c{false}.
* \note Shadows will be disabled when set to \c{true}.
*
@@ -1198,4 +1179,4 @@ QImage QAbstract3DGraphPrivate::renderToImage(int msaaSamples, const QSize &imag
return image;
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/qabstract3dgraph.h b/src/datavisualization/engine/qabstract3dgraph.h
index a59259d1..f3d8ecaa 100644
--- a/src/datavisualization/engine/qabstract3dgraph.h
+++ b/src/datavisualization/engine/qabstract3dgraph.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
#ifndef QABSTRACT3DGRAPH_H
#define QABSTRACT3DGRAPH_H
@@ -38,17 +12,16 @@
#include <QtGui/QOpenGLFunctions>
#include <QtCore/QLocale>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class QAbstract3DGraphPrivate;
class QCustom3DItem;
class QAbstract3DAxis;
+class QAbstract3DSeries;
-class QT_DATAVISUALIZATION_EXPORT QAbstract3DGraph : public QWindow, protected QOpenGLFunctions
+class Q_DATAVISUALIZATION_EXPORT QAbstract3DGraph : public QWindow, protected QOpenGLFunctions
{
Q_OBJECT
- Q_ENUMS(ShadowQuality)
- Q_ENUMS(ElementType)
Q_FLAGS(SelectionFlag SelectionFlags)
Q_FLAGS(OptimizationHint OptimizationHints)
Q_PROPERTY(QAbstract3DInputHandler* activeInputHandler READ activeInputHandler WRITE setActiveInputHandler NOTIFY activeInputHandlerChanged)
@@ -88,6 +61,7 @@ public:
SelectionSlice = 8,
SelectionMultiSeries = 16
};
+ Q_ENUM(SelectionFlag)
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
enum ShadowQuality {
@@ -99,6 +73,7 @@ public:
ShadowQualitySoftMedium,
ShadowQualitySoftHigh
};
+ Q_ENUM(ShadowQuality)
enum ElementType {
ElementNone = 0,
@@ -108,11 +83,13 @@ public:
ElementAxisZLabel,
ElementCustomItem
};
+ Q_ENUM(ElementType)
enum OptimizationHint {
OptimizationDefault = 0,
OptimizationStatic = 1
};
+ Q_ENUM(OptimizationHint)
Q_DECLARE_FLAGS(OptimizationHints, OptimizationHint)
public:
@@ -141,6 +118,8 @@ public:
void clearSelection();
+ bool hasSeries(QAbstract3DSeries *series) const;
+
int addCustomItem(QCustom3DItem *item);
void removeCustomItems();
void removeCustomItem(QCustom3DItem *item);
@@ -197,17 +176,17 @@ public:
bool hasContext() const;
protected:
- bool event(QEvent *event);
- void resizeEvent(QResizeEvent *event);
- void exposeEvent(QExposeEvent *event);
-
- void mouseDoubleClickEvent(QMouseEvent *event);
- void touchEvent(QTouchEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
+ bool event(QEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void exposeEvent(QExposeEvent *event) override;
+
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void touchEvent(QTouchEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event);
+ void wheelEvent(QWheelEvent *event) override;
#endif
Q_SIGNALS:
@@ -241,6 +220,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstract3DGraph::SelectionFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstract3DGraph::OptimizationHints)
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/qabstract3dgraph_p.h b/src/datavisualization/engine/qabstract3dgraph_p.h
index 88962a6b..ed86769f 100644
--- a/src/datavisualization/engine/qabstract3dgraph_p.h
+++ b/src/datavisualization/engine/qabstract3dgraph_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
@@ -47,7 +21,7 @@ class QOpenGLContext;
class QOffscreenSurface;
QT_END_NAMESPACE
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class QAbstract3DGraph;
class Abstract3DController;
@@ -86,6 +60,6 @@ public:
bool m_initialized;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/scatter3dcontroller.cpp b/src/datavisualization/engine/scatter3dcontroller.cpp
index 365617e0..af7bb204 100644
--- a/src/datavisualization/engine/scatter3dcontroller.cpp
+++ b/src/datavisualization/engine/scatter3dcontroller.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "scatter3dcontroller_p.h"
#include "scatter3drenderer_p.h"
@@ -34,7 +10,7 @@
#include "qscatter3dseries_p.h"
#include <QtCore/QMutexLocker>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
static const int insertRemoveRecordReserveSize = 31;
@@ -485,4 +461,4 @@ void Scatter3DController::adjustAxisRanges()
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/scatter3dcontroller_p.h b/src/datavisualization/engine/scatter3dcontroller_p.h
index 46acd282..175e4b82 100644
--- a/src/datavisualization/engine/scatter3dcontroller_p.h
+++ b/src/datavisualization/engine/scatter3dcontroller_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
@@ -40,10 +14,10 @@
#ifndef Q3DSCATTERCONTROLLER_p_H
#define Q3DSCATTERCONTROLLER_p_H
-#include "datavisualizationglobal_p.h"
-#include "abstract3dcontroller_p.h"
+#include <private/datavisualizationglobal_p.h>
+#include <private/abstract3dcontroller_p.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Scatter3DRenderer;
class QScatterDataProxy;
@@ -60,7 +34,7 @@ struct Scatter3DChangeBitField {
}
};
-class QT_DATAVISUALIZATION_EXPORT Scatter3DController : public Abstract3DController
+class Q_DATAVISUALIZATION_EXPORT Scatter3DController : public Abstract3DController
{
Q_OBJECT
@@ -107,28 +81,28 @@ public:
explicit Scatter3DController(QRect rect, Q3DScene *scene = 0);
~Scatter3DController();
- virtual void initializeOpenGL();
+ void initializeOpenGL() override;
// Change selection mode
- void setSelectionMode(QAbstract3DGraph::SelectionFlags mode);
+ void setSelectionMode(QAbstract3DGraph::SelectionFlags mode) override;
inline QScatter3DSeries *selectedSeries() const { return m_selectedItemSeries; }
void setSelectedItem(int index, QScatter3DSeries *series);
static inline int invalidSelectionIndex() { return -1; }
- virtual void clearSelection();
+ void clearSelection() override;
- void synchDataToRenderer();
+ void synchDataToRenderer() override;
- virtual void addSeries(QAbstract3DSeries *series);
- virtual void removeSeries(QAbstract3DSeries *series);
+ void addSeries(QAbstract3DSeries *series) override;
+ void removeSeries(QAbstract3DSeries *series) override;
virtual QList<QScatter3DSeries *> scatterSeriesList();
- virtual void handleAxisAutoAdjustRangeChangedInOrientation(
- QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust);
- virtual void handleAxisRangeChangedBySender(QObject *sender);
- virtual void handlePendingClick();
- virtual void adjustAxisRanges();
+ void handleAxisAutoAdjustRangeChangedInOrientation(
+ QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust) override;
+ void handleAxisRangeChangedBySender(QObject *sender) override;
+ void handlePendingClick() override;
+ void adjustAxisRanges() override;
public Q_SLOTS:
void handleArrayReset();
@@ -141,13 +115,13 @@ Q_SIGNALS:
void selectedSeriesChanged(QScatter3DSeries *series);
protected:
- virtual void startRecordingRemovesAndInserts();
+ void startRecordingRemovesAndInserts() override;
private:
Q_DISABLE_COPY(Scatter3DController)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp
index e999827e..6a224ebd 100644
--- a/src/datavisualization/engine/scatter3drenderer.cpp
+++ b/src/datavisualization/engine/scatter3drenderer.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "scatter3drenderer_p.h"
#include "q3dcamera_p.h"
@@ -42,7 +18,7 @@
// You should see the scene from where the light is
//#define SHOW_DEPTH_TEXTURE_SCENE
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
const GLfloat defaultMinSize = 0.01f;
const GLfloat defaultMaxSize = 0.1f;
@@ -376,7 +352,7 @@ void Scatter3DRenderer::updateItems(const QList<Scatter3DController::ChangeItem>
const int index = item.index;
if (index >= cache->renderArray().size())
continue; // Items removed from array for same render
- bool oldVisibility;
+ bool oldVisibility = false;
ScatterRenderItem &item = cache->renderArray()[index];
if (optimizationStatic)
oldVisibility = item.isVisible();
@@ -554,7 +530,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
ShaderHelper *pointSelectionShader;
if (!m_isOpenGLES) {
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (m_havePointSeries) {
glEnable(GL_POINT_SMOOTH);
glEnable(GL_PROGRAM_POINT_SIZE);
@@ -751,7 +727,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
float itemSize = cache->itemSize() / itemScaler;
if (itemSize == 0.0f)
itemSize = m_dotSizeScale;
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (drawingPoints && !m_isOpenGLES)
m_funcs_2_1->glPointSize(itemSize * activeCamera->zoomLevel());
#endif
@@ -884,7 +860,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
float itemSize = cache->itemSize() / itemScaler;
if (itemSize == 0.0f)
itemSize = m_dotSizeScale;
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (drawingPoints && !m_isOpenGLES)
m_funcs_2_1->glPointSize(itemSize * activeCamera->zoomLevel());
#endif
@@ -1195,7 +1171,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
}
}
-#if !defined(QT_OPENGL_ES_2)
+#if !QT_CONFIG(opengles2)
if (m_havePointSeries) {
glDisable(GL_POINT_SMOOTH);
glDisable(GL_PROGRAM_POINT_SIZE);
@@ -2528,4 +2504,4 @@ QVector3D Scatter3DRenderer::convertPositionToTranslation(const QVector3D &posit
return QVector3D(xTrans, yTrans, zTrans);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/scatter3drenderer_p.h b/src/datavisualization/engine/scatter3drenderer_p.h
index f0366e0c..c1673e80 100644
--- a/src/datavisualization/engine/scatter3drenderer_p.h
+++ b/src/datavisualization/engine/scatter3drenderer_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
@@ -47,14 +21,14 @@
QT_FORWARD_DECLARE_CLASS(QSizeF)
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class ShaderHelper;
class Q3DScene;
class ScatterSeriesRenderCache;
class QScatterDataItem;
-class QT_DATAVISUALIZATION_EXPORT Scatter3DRenderer : public Abstract3DRenderer
+class Q_DATAVISUALIZATION_EXPORT Scatter3DRenderer : public Abstract3DRenderer
{
Q_OBJECT
@@ -97,44 +71,44 @@ public:
explicit Scatter3DRenderer(Scatter3DController *controller);
~Scatter3DRenderer();
- 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 updateItems(const QList<Scatter3DController::ChangeItem> &items);
- void updateScene(Q3DScene *scene);
+ void updateScene(Q3DScene *scene) override;
void updateAxisLabels(QAbstract3DAxis::AxisOrientation orientation,
- const QStringList &labels);
+ const QStringList &labels) override;
void updateAxisTitleVisibility(QAbstract3DAxis::AxisOrientation orientation,
- bool visible);
- void updateOptimizationHint(QAbstract3DGraph::OptimizationHints hint);
- void updateMargin(float margin);
+ bool visible) override;
+ void updateOptimizationHint(QAbstract3DGraph::OptimizationHints hint) override;
+ void updateMargin(float margin) override;
- QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute);
+ QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute) override;
inline int clickedIndex() const { return m_clickedIndex; }
void resetClickedStatus();
- void render(GLuint defaultFboHandle);
+ void render(GLuint defaultFboHandle) override;
public Q_SLOTS:
void updateSelectedItem(int index, QScatter3DSeries *series);
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;
private:
- virtual void initShaders(const QString &vertexShader, const QString &fragmentShader);
- virtual void initGradientShaders(const QString &vertexShader, const QString &fragmentShader);
- virtual void initStaticSelectedItemShaders(const QString &vertexShader,
- const QString &fragmentShader,
- const QString &gradientVertexShader,
- const QString &gradientFragmentShader);
- 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 initStaticSelectedItemShaders(const QString &vertexShader,
+ const QString &fragmentShader,
+ const QString &gradientVertexShader,
+ const QString &gradientFragmentShader) override;
+ void updateShadowQuality(QAbstract3DGraph::ShadowQuality quality) override;
+ void updateTextures() override;
+ void fixMeshFileName(QString &fileName, QAbstract3DSeries::Mesh mesh) override;
void drawScene(GLuint defaultFboHandle);
void drawLabels(bool drawSelection, const Q3DCamera *activeCamera,
@@ -142,11 +116,11 @@ private:
void loadBackgroundMesh();
void initSelectionShader();
- void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader);
+ void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader) override;
void initStaticPointShaders(const QString &vertexShader, const QString &fragmentShader);
- void initSelectionBuffer();
+ void initSelectionBuffer() override;
void initDepthShader();
- void updateDepthBuffer();
+ void updateDepthBuffer() override;
void initPointShader();
void calculateTranslation(ScatterRenderItem &item);
void calculateSceneScalingFactors();
@@ -158,6 +132,6 @@ private:
Q_DISABLE_COPY(Scatter3DRenderer)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/scatterseriesrendercache.cpp b/src/datavisualization/engine/scatterseriesrendercache.cpp
index ba511f6c..2447076e 100644
--- a/src/datavisualization/engine/scatterseriesrendercache.cpp
+++ b/src/datavisualization/engine/scatterseriesrendercache.cpp
@@ -1,37 +1,11 @@
-/****************************************************************************
-**
-** 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
#include "scatterseriesrendercache_p.h"
#include "scatterobjectbufferhelper_p.h"
#include "scatterpointbufferhelper_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
ScatterSeriesRenderCache::ScatterSeriesRenderCache(QAbstract3DSeries *series,
Abstract3DRenderer *renderer)
@@ -60,4 +34,4 @@ void ScatterSeriesRenderCache::cleanup(TextureHelper *texHelper)
SeriesRenderCache::cleanup(texHelper);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/scatterseriesrendercache_p.h b/src/datavisualization/engine/scatterseriesrendercache_p.h
index 8f858d0f..f19909af 100644
--- a/src/datavisualization/engine/scatterseriesrendercache_p.h
+++ b/src/datavisualization/engine/scatterseriesrendercache_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
@@ -45,7 +19,7 @@
#include "qscatter3dseries_p.h"
#include "scatterrenderitem_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class ScatterObjectBufferHelper;
class ScatterPointBufferHelper;
@@ -56,7 +30,7 @@ public:
ScatterSeriesRenderCache(QAbstract3DSeries *series, Abstract3DRenderer *renderer);
virtual ~ScatterSeriesRenderCache();
- void cleanup(TextureHelper *texHelper);
+ void cleanup(TextureHelper *texHelper) override;
inline ScatterRenderItemArray &renderArray() { return m_renderArray; }
inline QScatter3DSeries *series() const { return static_cast<QScatter3DSeries *>(m_series); }
@@ -93,6 +67,6 @@ protected:
bool m_visibilityChanged; // Used to detect if full buffer change needed
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/selectionpointer.cpp b/src/datavisualization/engine/selectionpointer.cpp
index be4a52a9..d78171e3 100644
--- a/src/datavisualization/engine/selectionpointer.cpp
+++ b/src/datavisualization/engine/selectionpointer.cpp
@@ -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
#include "selectionpointer_p.h"
#include "shaderhelper_p.h"
@@ -34,9 +8,9 @@
#include "q3dcamera_p.h"
#include "utils_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
-const GLfloat sliceUnits = 2.5;
+const GLfloat spSliceUnits = 2.5;
SelectionPointer::SelectionPointer(Drawer *drawer)
: QObject(0),
@@ -94,7 +68,7 @@ void SelectionPointer::renderSelectionPointer(GLuint defaultFboHandle, bool useO
QMatrix4x4 projectionMatrix;
GLfloat viewPortRatio = (GLfloat)m_mainViewPort.width() / (GLfloat)m_mainViewPort.height();
if (m_cachedIsSlicingActivated) {
- GLfloat sliceUnitsScaled = sliceUnits / m_autoScaleAdjustment;
+ GLfloat sliceUnitsScaled = spSliceUnits / m_autoScaleAdjustment;
viewMatrix.lookAt(QVector3D(0.0f, 0.0f, 1.0f), zeroVector, upVector);
projectionMatrix.ortho(-sliceUnitsScaled * viewPortRatio, sliceUnitsScaled * viewPortRatio,
-sliceUnitsScaled, sliceUnitsScaled,
@@ -164,7 +138,7 @@ void SelectionPointer::renderSelectionLabel(GLuint defaultFboHandle, bool useOrt
QMatrix4x4 projectionMatrix;
GLfloat viewPortRatio = (GLfloat)m_mainViewPort.width() / (GLfloat)m_mainViewPort.height();
if (m_cachedIsSlicingActivated) {
- GLfloat sliceUnitsScaled = sliceUnits / m_autoScaleAdjustment;
+ GLfloat sliceUnitsScaled = spSliceUnits / m_autoScaleAdjustment;
viewMatrix.lookAt(QVector3D(0.0f, 0.0f, 1.0f), zeroVector, upVector);
projectionMatrix.ortho(-sliceUnitsScaled * viewPortRatio, sliceUnitsScaled * viewPortRatio,
-sliceUnitsScaled, sliceUnitsScaled,
@@ -305,4 +279,4 @@ void SelectionPointer::initShaders()
m_pointShader->initialize();
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/selectionpointer_p.h b/src/datavisualization/engine/selectionpointer_p.h
index 0ba9b53a..42041b9e 100644
--- a/src/datavisualization/engine/selectionpointer_p.h
+++ b/src/datavisualization/engine/selectionpointer_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
@@ -43,7 +17,7 @@
#include "datavisualizationglobal_p.h"
#include "surface3dcontroller_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class ShaderHelper;
class ObjectHelper;
@@ -95,6 +69,6 @@ private:
QQuaternion m_rotation;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/seriesrendercache.cpp b/src/datavisualization/engine/seriesrendercache.cpp
index 29c7a633..4794f605 100644
--- a/src/datavisualization/engine/seriesrendercache.cpp
+++ b/src/datavisualization/engine/seriesrendercache.cpp
@@ -1,38 +1,12 @@
-/****************************************************************************
-**
-** 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
#include "seriesrendercache_p.h"
#include "abstract3drenderer_p.h"
#include "texturehelper_p.h"
#include "utils_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
const QString smoothString(QStringLiteral("Smooth"));
@@ -206,4 +180,4 @@ void SeriesRenderCache::cleanup(TextureHelper *texHelper)
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/seriesrendercache_p.h b/src/datavisualization/engine/seriesrendercache_p.h
index c0932a4c..6f430a91 100644
--- a/src/datavisualization/engine/seriesrendercache_p.h
+++ b/src/datavisualization/engine/seriesrendercache_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
@@ -43,7 +17,7 @@
#include "datavisualizationglobal_p.h"
#include "qabstract3dseries_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Abstract3DRenderer;
class ObjectHelper;
@@ -110,7 +84,7 @@ protected:
bool m_staticObjectUVDirty;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/surface3dcontroller.cpp b/src/datavisualization/engine/surface3dcontroller.cpp
index ba845ac1..13b32666 100644
--- a/src/datavisualization/engine/surface3dcontroller.cpp
+++ b/src/datavisualization/engine/surface3dcontroller.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "surface3dcontroller_p.h"
#include "surface3drenderer_p.h"
@@ -34,7 +10,7 @@
#include "qsurface3dseries_p.h"
#include <QtCore/QMutexLocker>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
Surface3DController::Surface3DController(QRect rect, Q3DScene *scene)
: Abstract3DController(rect, scene),
@@ -602,4 +578,4 @@ void Surface3DController::adjustAxisRanges()
}
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/surface3dcontroller_p.h b/src/datavisualization/engine/surface3dcontroller_p.h
index 8cbfeb60..3d9276d8 100644
--- a/src/datavisualization/engine/surface3dcontroller_p.h
+++ b/src/datavisualization/engine/surface3dcontroller_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
@@ -40,10 +14,10 @@
#ifndef SURFACE3DCONTROLLER_P_H
#define SURFACE3DCONTROLLER_P_H
-#include "abstract3dcontroller_p.h"
-#include "datavisualizationglobal_p.h"
+#include <private/abstract3dcontroller_p.h>
+#include <private/datavisualizationglobal_p.h>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Surface3DRenderer;
class QSurface3DSeries;
@@ -65,7 +39,7 @@ struct Surface3DChangeBitField {
}
};
-class QT_DATAVISUALIZATION_EXPORT Surface3DController : public Abstract3DController
+class Q_DATAVISUALIZATION_EXPORT Surface3DController : public Abstract3DController
{
Q_OBJECT
@@ -95,27 +69,27 @@ public:
explicit Surface3DController(QRect rect, Q3DScene *scene = 0);
~Surface3DController();
- virtual void initializeOpenGL();
- virtual void synchDataToRenderer();
+ void initializeOpenGL() override;
+ void synchDataToRenderer() override;
- void setSelectionMode(QAbstract3DGraph::SelectionFlags mode);
+ void setSelectionMode(QAbstract3DGraph::SelectionFlags mode) override;
void setSelectedPoint(const QPoint &position, QSurface3DSeries *series, bool enterSlice);
- virtual void clearSelection();
+ void clearSelection() override;
inline QSurface3DSeries *selectedSeries() const { return m_selectedSeries; }
- virtual void handleAxisAutoAdjustRangeChangedInOrientation(
- QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust);
- virtual void handleAxisRangeChangedBySender(QObject *sender);
- virtual void handleSeriesVisibilityChangedBySender(QObject *sender);
- virtual void handlePendingClick();
- virtual void adjustAxisRanges();
+ void handleAxisAutoAdjustRangeChangedInOrientation(
+ QAbstract3DAxis::AxisOrientation orientation, bool autoAdjust) override;
+ void handleAxisRangeChangedBySender(QObject *sender) override;
+ void handleSeriesVisibilityChangedBySender(QObject *sender) override;
+ void handlePendingClick() override;
+ void adjustAxisRanges() override;
static QPoint invalidSelectionPosition();
bool isFlatShadingSupported();
- virtual void addSeries(QAbstract3DSeries *series);
- virtual void removeSeries(QAbstract3DSeries *series);
+ void addSeries(QAbstract3DSeries *series) override;
+ void removeSeries(QAbstract3DSeries *series) override;
virtual QList<QSurface3DSeries *> surfaceSeriesList();
void setFlipHorizontalGrid(bool flip);
@@ -141,6 +115,6 @@ private:
Q_DISABLE_COPY(Surface3DController)
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index ea4f23e7..cffed56d 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -1,31 +1,7 @@
-/****************************************************************************
-**
-** 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
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "surface3drenderer_p.h"
#include "q3dcamera_p.h"
@@ -37,7 +13,7 @@
static const int ID_TO_RGBA_MASK = 0xff;
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
//#define SHOW_DEPTH_TEXTURE_SCENE
@@ -3062,4 +3038,4 @@ void Surface3DRenderer::updateMargin(float margin)
calculateSceneScalingFactors();
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/surface3drenderer_p.h b/src/datavisualization/engine/surface3drenderer_p.h
index d527f248..e60abbc0 100644
--- a/src/datavisualization/engine/surface3drenderer_p.h
+++ b/src/datavisualization/engine/surface3drenderer_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
@@ -45,12 +19,12 @@
#include "abstract3drenderer_p.h"
#include "surfaceseriesrendercache_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class ShaderHelper;
class Q3DScene;
-class QT_DATAVISUALIZATION_EXPORT Surface3DRenderer : public Abstract3DRenderer
+class Q_DATAVISUALIZATION_EXPORT Surface3DRenderer : public Abstract3DRenderer
{
Q_OBJECT
@@ -92,34 +66,34 @@ public:
explicit Surface3DRenderer(Surface3DController *controller);
~Surface3DRenderer();
- void updateData();
- void updateSeries(const QList<QAbstract3DSeries *> &seriesList);
+ void updateData() override;
+ void updateSeries(const QList<QAbstract3DSeries *> &seriesList) override;
void updateSurfaceTextures(QList<QSurface3DSeries *> seriesList);
- SeriesRenderCache *createNewCache(QAbstract3DSeries *series);
- void cleanCache(SeriesRenderCache *cache);
- void updateSelectionMode(QAbstract3DGraph::SelectionFlags mode);
+ SeriesRenderCache *createNewCache(QAbstract3DSeries *series) override;
+ void cleanCache(SeriesRenderCache *cache) override;
+ void updateSelectionMode(QAbstract3DGraph::SelectionFlags mode) override;
void updateRows(const QList<Surface3DController::ChangeRow> &rows);
void updateItems(const QList<Surface3DController::ChangeItem> &points);
- void updateScene(Q3DScene *scene);
+ void updateScene(Q3DScene *scene) override;
void updateSlicingActive(bool isSlicing);
void updateSelectedPoint(const QPoint &position, QSurface3DSeries *series);
void updateFlipHorizontalGrid(bool flip);
inline QPoint clickedPosition() const { return m_clickedPosition; }
void resetClickedStatus();
- QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute);
+ QVector3D convertPositionToTranslation(const QVector3D &position, bool isAbsolute) override;
void updateAxisLabels(QAbstract3DAxis::AxisOrientation orientation,
- const QStringList &labels);
+ const QStringList &labels) override;
void updateAxisTitleVisibility(QAbstract3DAxis::AxisOrientation orientation,
- bool visible);
- void updateMargin(float margin);
+ bool visible) override;
+ void updateMargin(float margin) override;
- void render(GLuint defaultFboHandle = 0);
+ void render(GLuint defaultFboHandle = 0) override;
protected:
- void contextCleanup();
- void initializeOpenGL();
- virtual void fixCameraTarget(QVector3D &target);
- virtual void getVisibleItemBounds(QVector3D &minBounds, QVector3D &maxBounds);
+ void contextCleanup() override;
+ void initializeOpenGL() override;
+ virtual void fixCameraTarget(QVector3D &target) override;
+ virtual void getVisibleItemBounds(QVector3D &minBounds, QVector3D &maxBounds) override;
Q_SIGNALS:
void flatShadingSupportedChanged(bool supported);
@@ -132,9 +106,9 @@ private:
void findMatchingRow(float z, int &sample, int direction, QSurfaceDataArray &dataArray);
void findMatchingColumn(float x, int &sample, int direction, QSurfaceDataArray &dataArray);
void updateSliceObject(SurfaceSeriesRenderCache *cache, const QPoint &point);
- void updateShadowQuality(QAbstract3DGraph::ShadowQuality quality);
- void updateTextures();
- void initShaders(const QString &vertexShader, const QString &fragmentShader);
+ void updateShadowQuality(QAbstract3DGraph::ShadowQuality quality) override;
+ void updateTextures() override;
+ void initShaders(const QString &vertexShader, const QString &fragmentShader) override;
QRect calculateSampleRect(const QSurfaceDataArray &array);
void loadBackgroundMesh();
@@ -144,10 +118,10 @@ private:
const QMatrix4x4 &viewMatrix, const QMatrix4x4 &projectionMatrix);
void calculateSceneScalingFactors();
- void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader);
+ void initBackgroundShaders(const QString &vertexShader, const QString &fragmentShader) override;
void initSelectionShaders();
void initSurfaceShaders();
- void initSelectionBuffer();
+ void initSelectionBuffer() override;
void initDepthShader();
void updateSelectionTextures();
void createSelectionTexture(SurfaceSeriesRenderCache *cache, uint &lastSelectionId);
@@ -156,7 +130,7 @@ private:
void surfacePointSelected(const QPoint &point);
void updateSelectionPoint(SurfaceSeriesRenderCache *cache, const QPoint &point, bool label);
QPoint selectionIdToSurfacePoint(uint id);
- void updateDepthBuffer();
+ void updateDepthBuffer() override;
void emitSelectedPointChanged(QPoint position);
Q_DISABLE_COPY(Surface3DRenderer)
@@ -164,6 +138,6 @@ private:
friend class SurfaceObject;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif
diff --git a/src/datavisualization/engine/surfaceseriesrendercache.cpp b/src/datavisualization/engine/surfaceseriesrendercache.cpp
index 3d2b7363..94b92ff5 100644
--- a/src/datavisualization/engine/surfaceseriesrendercache.cpp
+++ b/src/datavisualization/engine/surfaceseriesrendercache.cpp
@@ -1,37 +1,11 @@
-/****************************************************************************
-**
-** 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
#include "surfaceseriesrendercache_p.h"
#include "surface3drenderer_p.h"
#include "texturehelper_p.h"
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
SurfaceSeriesRenderCache::SurfaceSeriesRenderCache(QAbstract3DSeries *series,
Surface3DRenderer *renderer)
@@ -66,6 +40,10 @@ void SurfaceSeriesRenderCache::populate(bool newSeries)
QSurface3DSeries::DrawFlags drawMode = series()->drawMode();
m_surfaceVisible = drawMode.testFlag(QSurface3DSeries::DrawSurface);
m_surfaceGridVisible = drawMode.testFlag(QSurface3DSeries::DrawWireframe);
+ QColor lineColor = series()->wireframeColor();
+ m_surfaceObj->setLineColor(lineColor);
+ m_sliceSurfaceObj->setLineColor(lineColor);
+
if (m_flatChangeAllowed && m_surfaceFlatShading != series()->isFlatShadingEnabled()) {
m_surfaceFlatShading = series()->isFlatShadingEnabled();
m_flatStatusDirty = true;
@@ -95,4 +73,4 @@ void SurfaceSeriesRenderCache::cleanup(TextureHelper *texHelper)
SeriesRenderCache::cleanup(texHelper);
}
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
diff --git a/src/datavisualization/engine/surfaceseriesrendercache_p.h b/src/datavisualization/engine/surfaceseriesrendercache_p.h
index 4d435cd5..f61e6ad3 100644
--- a/src/datavisualization/engine/surfaceseriesrendercache_p.h
+++ b/src/datavisualization/engine/surfaceseriesrendercache_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
@@ -48,7 +22,7 @@
#include <QtGui/QMatrix4x4>
-QT_BEGIN_NAMESPACE_DATAVISUALIZATION
+QT_BEGIN_NAMESPACE
class Surface3DRenderer;
@@ -58,8 +32,8 @@ public:
SurfaceSeriesRenderCache(QAbstract3DSeries *series, Surface3DRenderer *renderer);
virtual ~SurfaceSeriesRenderCache();
- virtual void populate(bool newSeries);
- virtual void cleanup(TextureHelper *texHelper);
+ void populate(bool newSeries) override;
+ void cleanup(TextureHelper *texHelper) override;
inline bool surfaceVisible() const { return m_surfaceVisible; }
inline bool surfaceGridVisible() const { return m_surfaceGridVisible; }
@@ -121,6 +95,6 @@ protected:
GLuint m_surfaceTexture;
};
-QT_END_NAMESPACE_DATAVISUALIZATION
+QT_END_NAMESPACE
#endif