diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2023-02-03 10:17:27 +0200 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2023-02-10 10:41:08 +0200 |
commit | 6b9e8224c2e567ed0f42fa5ebc442d201615fa3e (patch) | |
tree | 6d73abb585ac2ad95544b5a9a8b88ea6e886e266 /examples/datavisualization/qmlsurface/doc | |
parent | 0dfb996b629d2815bccf32c481680c249f3133c9 (diff) |
Combine 3 examples into one qmlsurfacegallery
Combine qmlsurface, qml3doscilloscope, and qmlspectrogram into
one surface graph gallery example.
Pick-to: 6.5
Fixes: QTBUG-110700
Change-Id: Ic8319884a61a12c5d65c68314c958a86d62a65b1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'examples/datavisualization/qmlsurface/doc')
-rw-r--r-- | examples/datavisualization/qmlsurface/doc/images/qmlsurface-example.png | bin | 334593 -> 0 bytes | |||
-rw-r--r-- | examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc | 97 |
2 files changed, 0 insertions, 97 deletions
diff --git a/examples/datavisualization/qmlsurface/doc/images/qmlsurface-example.png b/examples/datavisualization/qmlsurface/doc/images/qmlsurface-example.png Binary files differdeleted file mode 100644 index 5e37b42c..00000000 --- a/examples/datavisualization/qmlsurface/doc/images/qmlsurface-example.png +++ /dev/null diff --git a/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc b/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc deleted file mode 100644 index 1f338536..00000000 --- a/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example qmlsurface - \meta tags {DataVisualization, Surface3D, Height Map} - \meta category {Graphics} - \title Surface Graph from Height Data - \ingroup qtdatavisualization_qmlexamples - \brief Using Surface3D in a QML application. - - The surface graph example shows how to make a simple 3D surface plot using Surface3D - with QML. - - \image qmlsurface-example.png - - The focus in this example is on generating a surface graph from height data, so in this section - we skip explaining the application creation. For more detailed QML example documentation, - see \l{Simple Scatter Graph}. - - \include examples-run.qdocinc - - \section1 Adding Data to the Graph - - This example shows two methods to set data to surface graph, using the HeightMapSurfaceDataProxy - and ItemModelSurfaceDataProxy. First we go through setting the data using the height map specific - data proxy. It is done with the code snippet below. The proxy itself is contained in a - Surface3DSeries. Inside the HeightMapSurfaceDataProxy the \c heightMapFile specifies the - image file containing the height data. The value properties in the proxy define the minimum - and maximum values for surface area width and depth. This example shows the terrain around Tycho - crater at imaginary position from 67 to 97 and from 30 to 60. Note that on the graph the scale - on the Y dimension exaggerates the height. - - \snippet qmlsurface/qml/qmlsurface/main.qml 4 - - The other method to set surface data used in this example is with model mapping. We do that by - first defining a \c ListModel containing the data for the surface: - - \snippet qmlsurface/qml/qmlsurface/Data.qml 0 - \dots 4 - - Then we set up a Surface3DSeries with a ItemModelSurfaceDataProxy: - - \snippet qmlsurface/qml/qmlsurface/main.qml 5 - \dots - - We add the actual data to the \c itemModel of the ItemModelSurfaceDataProxy. We also define the - roles for columns, rows and values. In this example the row holds values for longitude, column - for latitude and the value is for height. - - \dots 0 - \snippet qmlsurface/qml/qmlsurface/main.qml 6 - - \section1 Showing Data - - In the \c main.qml, we set up the Surface3D element to show the data and various UI elements - to illustrate few interesting features. - - First is the gradient to be used for the surface, which can be defined as seen in the following - snippet. With the ColorGradient we set example colors from position 0.0 to 1.0. - - \snippet qmlsurface/qml/qmlsurface/main.qml 0 - - This element is set into the \c baseGradients property in the \c theme used in Surface3D: - - \snippet qmlsurface/qml/qmlsurface/main.qml 7 - - Other interesting features can be controlled with buttons. - - The first button is to toggle on and off the surface grid, for which we use the following code: - - \snippet qmlsurface/qml/qmlsurface/main.qml 1 - - Second button is for surface shading mode, which is controlled with this code: - - \snippet qmlsurface/qml/qmlsurface/main.qml 2 - - Third button is for series visibility, which is controlled with this code: - - \snippet qmlsurface/qml/qmlsurface/main.qml 8 - - Notice that the \c drawMode and \c flatShadingEnable properties are set for both series. - - Fourth and fifth buttons are for controlling background features. - - The last button is for switching between the two series, one of which uses - HeightMapSurfaceDataProxy and the other one ItemModelSurfaceDataProxy. For this we use the - following code: - - \snippet qmlsurface/qml/qmlsurface/main.qml 3 - - We also set the maximum value to 500 in model proxy to make the surface flatter and - 250 on height map proxy to show exaggerated height. At the same time the middle color position - on the gradient is modified to match the value range change. - - \section1 Example Contents -*/ |