summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/qmlsurfacelayers
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2023-01-25 10:17:39 +0200
committerTomi Korpipaa <tomi.korpipaa@qt.io>2023-01-27 13:03:06 +0200
commitfcb72898b2c8f05ee1a5d2e2e192cc3b9afba486 (patch)
tree47772886667b9f43f146cbf5cbb35b6c908ee98c /examples/datavisualization/qmlsurfacelayers
parent7e9e9d00f0e3def86f679d38e9f30aa5e32e682a (diff)
Fix example naming and categories
Remove 2 more irrelevant examples Pick-to: 6.5 Fixes: QTBUG-110463 Change-Id: I9597f311d36fb79db45f6f64fb97bc5376372980 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'examples/datavisualization/qmlsurfacelayers')
-rw-r--r--examples/datavisualization/qmlsurfacelayers/CMakeLists.txt56
-rw-r--r--examples/datavisualization/qmlsurfacelayers/doc/images/qmlsurfacelayers-example.pngbin91579 -> 0 bytes
-rw-r--r--examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc67
-rw-r--r--examples/datavisualization/qmlsurfacelayers/layer_1.pngbin34540 -> 0 bytes
-rw-r--r--examples/datavisualization/qmlsurfacelayers/layer_2.pngbin10563 -> 0 bytes
-rw-r--r--examples/datavisualization/qmlsurfacelayers/layer_3.pngbin13022 -> 0 bytes
-rw-r--r--examples/datavisualization/qmlsurfacelayers/main.cpp38
-rw-r--r--examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml293
-rw-r--r--examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.pro12
-rw-r--r--examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.qrc10
10 files changed, 0 insertions, 476 deletions
diff --git a/examples/datavisualization/qmlsurfacelayers/CMakeLists.txt b/examples/datavisualization/qmlsurfacelayers/CMakeLists.txt
deleted file mode 100644
index d31c1cbf..00000000
--- a/examples/datavisualization/qmlsurfacelayers/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(qmlsurfacelayers LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Quick)
-find_package(Qt6 COMPONENTS DataVisualization)
-
-qt_add_executable(qmlsurfacelayers
- main.cpp
-)
-set_target_properties(qmlsurfacelayers PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(qmlsurfacelayers PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
- Qt::DataVisualization
-)
-
-qt6_add_qml_module(qmlsurfacelayers
- URI SurfaceLayers
- VERSION 1.0
- NO_RESOURCE_TARGET_PATH
- QML_FILES
- qml/qmlsurfacelayers/main.qml
- RESOURCES
- layer_1.png
- layer_2.png
- layer_3.png
-)
-
-install(TARGETS qmlsurfacelayers
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/datavisualization/qmlsurfacelayers/doc/images/qmlsurfacelayers-example.png b/examples/datavisualization/qmlsurfacelayers/doc/images/qmlsurfacelayers-example.png
deleted file mode 100644
index c5a48fcb..00000000
--- a/examples/datavisualization/qmlsurfacelayers/doc/images/qmlsurfacelayers-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc b/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc
deleted file mode 100644
index a70d36e1..00000000
--- a/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example qmlsurfacelayers
- \title Qt Quick 2 Surface Multiseries Example
- \ingroup qtdatavisualization_examples
- \brief Using multiple series with Surface3D in a QML application.
-
- The Qt Quick 2 surface example shows how to make a 3D surface plot displaying 3 layers using
- Surface3D with Qt Quick 2.
-
- \image qmlsurfacelayers-example.png
-
- The focus in this example is on generating a multiseries surface plot from 3 different height
- map images, so in this section we skip explaining the application creation. For a more detailed
- QML example documentation, see \l{Qt Quick 2 Scatter Example}.
-
- \include examples-run.qdocinc
-
- \section1 Adding Data to the Graph
-
- This example shows how to add several surface series to one graph using using
- HeightMapSurfaceDataProxies and how to control their visibilities individually.
-
- Let's start by creating a specific gradient for each layer:
-
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 0
-
- Then we'll create the series themselves. It happens simply by adding 3 separate Surface3DSeries
- to the Surface3D graph as children:
-
- \dots 0
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 1
- \dots 0
-
- You'll notice we added the created gradients to the \c baseGradient properties of the series.
- We could have added them to the \c baseGradients property of the Theme3D in Surface3D instead,
- but doing it this way ensures each gradient is applied to a correct series:
-
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 2
- \dots
-
- \section1 Controlling the Graph
-
- Let's add some checkboxes to control the visibility of layers:
-
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 3
-
- We don't need to do anything on the \c onCheckedChanged as we bound the \c checked state to
- the \c visible property of the series directly:
-
- \dots 0
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 4
- \dots 0
-
- Let's add some more checkboxes to control how the layers are displayed, when visible:
-
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 5
-
- In addition to these we have three buttons, one of which is of special interest to us. It is
- used to control whether we want to slice into only one layer, or all of them:
-
- \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 6
-
- \section1 Example Contents
-*/
diff --git a/examples/datavisualization/qmlsurfacelayers/layer_1.png b/examples/datavisualization/qmlsurfacelayers/layer_1.png
deleted file mode 100644
index 9138c710..00000000
--- a/examples/datavisualization/qmlsurfacelayers/layer_1.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/qmlsurfacelayers/layer_2.png b/examples/datavisualization/qmlsurfacelayers/layer_2.png
deleted file mode 100644
index 3af154e2..00000000
--- a/examples/datavisualization/qmlsurfacelayers/layer_2.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/qmlsurfacelayers/layer_3.png b/examples/datavisualization/qmlsurfacelayers/layer_3.png
deleted file mode 100644
index 796df64d..00000000
--- a/examples/datavisualization/qmlsurfacelayers/layer_3.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/qmlsurfacelayers/main.cpp b/examples/datavisualization/qmlsurfacelayers/main.cpp
deleted file mode 100644
index eec92367..00000000
--- a/examples/datavisualization/qmlsurfacelayers/main.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
-
-#include <QtDataVisualization/qutils.h>
-
-#include <QtGui/QGuiApplication>
-#include <QtCore/QDir>
-#include <QtQuick/QQuickView>
-#include <QtQml/QQmlEngine>
-
-int main(int argc, char *argv[])
-{
- qputenv("QSG_RHI_BACKEND", "opengl");
- QGuiApplication app(argc, argv);
-
- QQuickView viewer;
-
- // Enable antialiasing in direct rendering mode
- viewer.setFormat(qDefaultSurfaceFormat(true));
-
- // The following are needed to make examples run without having to install the module
- // in desktop environments.
-#ifdef Q_OS_WIN
- QString extraImportPath(QStringLiteral("%1/../../../../%2"));
-#else
- QString extraImportPath(QStringLiteral("%1/../../../%2"));
-#endif
- viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(),
- QString::fromLatin1("qml")));
-
- viewer.setSource(QUrl("qrc:/qml/qmlsurfacelayers/main.qml"));
-
- viewer.setTitle(QStringLiteral("3-layered Terrain"));
- viewer.setResizeMode(QQuickView::SizeRootObjectToView);
- viewer.show();
-
- return app.exec();
-}
diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml
deleted file mode 100644
index 774bd3f5..00000000
--- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml
+++ /dev/null
@@ -1,293 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
-
-import QtQuick
-import QtQuick.Layouts
-import QtQuick.Controls
-import QtDataVisualization
-
-Item {
- id: mainview
- width: 1280
- height: 720
-
- property real fontSize: 12
- property bool portraitMode: width < height
-
- Item {
- id: surfaceView
- width: mainview.width - settings.width
- height: mainview.height
- anchors.right: mainview.right
-
- //! [0]
- ColorGradient {
- id: layerOneGradient
- ColorGradientStop { position: 0.0; color: "black" }
- ColorGradientStop { position: 0.31; color: "tan" }
- ColorGradientStop { position: 0.32; color: "green" }
- ColorGradientStop { position: 0.40; color: "darkslategray" }
- ColorGradientStop { position: 1.0; color: "white" }
- }
-
- ColorGradient {
- id: layerTwoGradient
- ColorGradientStop { position: 0.315; color: "blue" }
- ColorGradientStop { position: 0.33; color: "white" }
- }
-
- ColorGradient {
- id: layerThreeGradient
- ColorGradientStop { position: 0.0; color: "red" }
- ColorGradientStop { position: 0.15; color: "black" }
- }
- //! [0]
-
- Surface3D {
- id: surfaceLayers
- width: surfaceView.width
- height: surfaceView.height
- theme: Theme3D {
- type: Theme3D.ThemeEbony
- font.pointSize: 35
- colorStyle: Theme3D.ColorStyleRangeGradient
- }
- shadowQuality: AbstractGraph3D.ShadowQualityNone
- selectionMode: AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice
- scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeft
- axisY.min: 20
- axisY.max: 200
- axisX.segmentCount: 5
- axisX.subSegmentCount: 2
- axisX.labelFormat: "%i"
- axisZ.segmentCount: 5
- axisZ.subSegmentCount: 2
- axisZ.labelFormat: "%i"
- axisY.segmentCount: 5
- axisY.subSegmentCount: 2
- axisY.labelFormat: "%i"
-
- //! [1]
- //! [2]
- Surface3DSeries {
- id: layerOneSeries
- baseGradient: layerOneGradient
- //! [2]
- HeightMapSurfaceDataProxy {
- heightMapFile: ":/layer_1.png"
- }
- flatShadingEnabled: false
- drawMode: Surface3DSeries.DrawSurface
- //! [4]
- visible: layerOneToggle.checked // bind to checkbox state
- //! [4]
- }
-
- Surface3DSeries {
- id: layerTwoSeries
- baseGradient: layerTwoGradient
- HeightMapSurfaceDataProxy {
- heightMapFile: ":/layer_2.png"
- }
- flatShadingEnabled: false
- drawMode: Surface3DSeries.DrawSurface
- visible: layerTwoToggle.checked // bind to checkbox state
- }
-
- Surface3DSeries {
- id: layerThreeSeries
- baseGradient: layerThreeGradient
- HeightMapSurfaceDataProxy {
- heightMapFile: ":/layer_3.png"
- }
- flatShadingEnabled: false
- drawMode: Surface3DSeries.DrawSurface
- visible: layerThreeToggle.checked // bind to checkbox state
- }
- //! [1]
- }
- }
-
- Flickable {
- id: settings
- width: buttonLayout.implicitWidth
- contentHeight: buttonLayout.implicitHeight
- height: mainview.height
-
- ColumnLayout {
- id: buttonLayout
- anchors.top: parent.top
- anchors.left: parent.left
- spacing: 0
-
- //! [3]
- GroupBox {
- Layout.fillWidth: true
- Column {
- spacing: 10
-
- Label {
- font.pointSize: mainview.fontSize
- font.bold: true
- text: mainview.portraitMode ? "Layer\nSelection" : "Layer Selection"
- }
-
- CheckBox {
- id: layerOneToggle
- checked: true
- text: mainview.portraitMode ? "Show\nGround\nLayer" : "Show Ground Layer"
- }
-
- CheckBox {
- id: layerTwoToggle
- checked: true
- text: mainview.portraitMode ? "Show\nSea\nLayer" : "Show Sea Layer"
- }
-
- CheckBox {
- id: layerThreeToggle
- checked: true
- text: mainview.portraitMode ? "Show\nTectonic\nLayer" : "Show Tectonic Layer"
- }
- }
- }
- //! [3]
-
- //! [5]
- GroupBox {
- Layout.fillWidth: true
- Column {
- spacing: 10
-
- Label {
- font.pointSize: mainview.fontSize
- font.bold: true
- text: mainview.portraitMode ? "Layer\nStyle" : "Layer Style"
- }
-
- CheckBox {
- id: layerOneGrid
- text: mainview.portraitMode ? "Show\nGround\nas Grid" : "Show Ground as Grid"
- onCheckedChanged: {
- if (checked)
- layerOneSeries.drawMode = Surface3DSeries.DrawWireframe;
- else
- layerOneSeries.drawMode = Surface3DSeries.DrawSurface;
- }
- }
-
- CheckBox {
- id: layerTwoGrid
- text: mainview.portraitMode ? "Show\nSea\nas Grid" : "Show Sea as Grid"
-
- onCheckedChanged: {
- if (checked)
- layerTwoSeries.drawMode = Surface3DSeries.DrawWireframe;
- else
- layerTwoSeries.drawMode = Surface3DSeries.DrawSurface;
- }
- }
-
- CheckBox {
- id: layerThreeGrid
- text: mainview.portraitMode ? "Show\nTectonic\nas Grid"
- : "Show Tectonic as Grid"
- onCheckedChanged: {
- if (checked)
- layerThreeSeries.drawMode = Surface3DSeries.DrawWireframe;
- else
- layerThreeSeries.drawMode = Surface3DSeries.DrawSurface;
- }
- }
- }
- }
- //! [5]
-
- //! [6]
- Button {
- id: sliceButton
- text: mainview.portraitMode ? "Slice\nAll\nLayers" : "Slice All Layers"
- Layout.fillWidth: true
- Layout.minimumHeight: 40
- onClicked: {
- if (surfaceLayers.selectionMode & AbstractGraph3D.SelectionMultiSeries) {
- surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow
- | AbstractGraph3D.SelectionSlice
- text = mainview.portraitMode ? "Slice\nAll\nLayers" : "Slice All Layers";
- } else {
- surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow
- | AbstractGraph3D.SelectionSlice
- | AbstractGraph3D.SelectionMultiSeries
- text = mainview.portraitMode ? "Slice\nOne\nLayer" : "Slice One Layer";
- }
- }
- }
- //! [6]
-
- Button {
- id: shadowButton
- Layout.fillWidth: true
- Layout.minimumHeight: 40
- text: surfaceLayers.shadowsSupported ? (mainview.portraitMode ? "Show\nShadows" : "Show Shadows")
- : (mainview.portraitMode ? "Shadows\nnot\nsupported" : "Shadows not supported")
- enabled: surfaceLayers.shadowsSupported
- onClicked: {
- if (surfaceLayers.shadowQuality === AbstractGraph3D.ShadowQualityNone) {
- surfaceLayers.shadowQuality = AbstractGraph3D.ShadowQualityLow;
- text = mainview.portraitMode ? "Hide\nShadows" : "Hide Shadows";
- } else {
- surfaceLayers.shadowQuality = AbstractGraph3D.ShadowQualityNone;
- text = mainview.portraitMode ? "Show\nShadows" : "Show Shadows";
- }
- }
- }
-
- Button {
- id: renderModeButton
- text: mainview.portraitMode ? "Switch\nRender\nMode" : "Switch Render Mode"
- Layout.fillWidth: true
- Layout.minimumHeight: 40
- onClicked: {
- var modeText = "Indirect, ";
- var aaText;
- if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect &&
- surfaceLayers.msaaSamples === 0) {
- surfaceLayers.renderingMode = AbstractGraph3D.RenderDirectToBackground;
- modeText = "BackGround, ";
- } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect &&
- surfaceLayers.msaaSamples === 4) {
- surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect;
- surfaceLayers.msaaSamples = 0;
- } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect &&
- surfaceLayers.msaaSamples === 8) {
- surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect;
- surfaceLayers.msaaSamples = 4;
- } else {
- surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect;
- surfaceLayers.msaaSamples = 8;
- }
-
- if (surfaceLayers.msaaSamples <= 0) {
- aaText = "No AA";
- } else {
- aaText = surfaceLayers.msaaSamples + "xMSAA";
- }
-
- renderLabel.text = modeText + aaText;
- }
- }
-
- TextField {
- id: renderLabel
- font.pointSize: mainview.fontSize
- Layout.fillWidth: true
- Layout.minimumHeight: 40
- color: "gray"
- enabled: false
- horizontalAlignment: TextInput.AlignHCenter
- wrapMode: TextField.WrapAtWordBoundaryOrAnywhere
- text: "Indirect, " + surfaceLayers.msaaSamples + "xMSAA"
- }
- }
- }
-}
diff --git a/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.pro b/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.pro
deleted file mode 100644
index 2bfa904d..00000000
--- a/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-!include( ../examples.pri ) {
- error( "Couldn't find the examples.pri file!" )
-}
-
-# The .cpp file which was generated for your project. Feel free to hack it.
-SOURCES += main.cpp
-
-RESOURCES += qmlsurfacelayers.qrc
-
-OTHER_FILES += doc/src/* \
- doc/images/* \
- qml/qmlsurfacelayers/*
diff --git a/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.qrc b/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.qrc
deleted file mode 100644
index 71c2ea33..00000000
--- a/examples/datavisualization/qmlsurfacelayers/qmlsurfacelayers.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/qmlsurfacelayers/main.qml</file>
- </qresource>
- <qresource prefix="/heightmaps">
- <file>layer_1.png</file>
- <file>layer_2.png</file>
- <file>layer_3.png</file>
- </qresource>
-</RCC>