From 88cd10aa7b3559b092cf5575b0a17d002dc100ae Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 13 Feb 2014 09:59:52 +0200 Subject: Fix examples installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Had to add one folder to the examples structure so installation works correctly. Change-Id: Ic92dfe9997413a6243abcf5eeba12744ba9e938c Reviewed-by: Tomi Korpipää --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 234 +++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml new file mode 100644 index 00000000..22c527a2 --- /dev/null +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 +import QtDataVisualization 1.0 +import "." + +Item { + id: mainview + width: 1280 + height: 720 + + Item { + id: surfaceView + width: mainview.width - buttonLayout.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.0; color: "red" } + ColorGradientStop { position: 0.15; color: "black" } + } + + ColorGradient { + id: layerThreeGradient + ColorGradientStop { position: 0.315; color: "blue" } + ColorGradientStop { position: 0.33; color: "white" } + } + //! [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: ":/heightmaps/layer_1.png" + } + flatShadingEnabled: false + drawMode: Surface3DSeries.DrawSurface + //! [4] + visible: layerOneToggle.checked // bind to checkbox state + //! [4] + } + + Surface3DSeries { + id: layerTwoSeries + baseGradient: layerTwoGradient + HeightMapSurfaceDataProxy { + heightMapFile: ":/heightmaps/layer_2.png" + } + flatShadingEnabled: false + drawMode: Surface3DSeries.DrawSurface + visible: layerTwoToggle.checked // bind to checkbox state + } + + Surface3DSeries { + id: layerThreeSeries + baseGradient: layerThreeGradient + HeightMapSurfaceDataProxy { + heightMapFile: ":/heightmaps/layer_3.png" + } + flatShadingEnabled: false + drawMode: Surface3DSeries.DrawSurface + visible: layerThreeToggle.checked // bind to checkbox state + } + //! [1] + } + } + + ColumnLayout { + id: buttonLayout + anchors.top: parent.top + anchors.left: parent.left + spacing: 0 + + //! [3] + GroupBox { + title: "Layer Selection" + Layout.fillWidth: true + Column { + CheckBox { + id: layerOneToggle + text: "Show Ground Layer" + checked: true + } + + CheckBox { + id: layerTwoToggle + text: "Show Tectonic Layer" + checked: true + } + + CheckBox { + id: layerThreeToggle + text: "Show Sea Layer" + checked: true + } + } + } + //! [3] + + //! [5] + GroupBox { + title: "Layer Style" + Layout.fillWidth: true + Column { + CheckBox { + id: layerOneGrid + text: "Show Ground as Grid" + onCheckedChanged: { + if (checked) + layerOneSeries.drawMode = Surface3DSeries.DrawWireframe + else + layerOneSeries.drawMode = Surface3DSeries.DrawSurface + } + } + + CheckBox { + id: layerTwoGrid + text: "Show Tectonic as Grid" + onCheckedChanged: { + if (checked) + layerTwoSeries.drawMode = Surface3DSeries.DrawWireframe + else + layerTwoSeries.drawMode = Surface3DSeries.DrawSurface + } + } + + CheckBox { + id: layerThreeGrid + text: "Show Sea as Grid" + onCheckedChanged: { + if (checked) + layerThreeSeries.drawMode = Surface3DSeries.DrawWireframe + else + layerThreeSeries.drawMode = Surface3DSeries.DrawSurface + } + } + } + } + //! [5] + + //! [6] + NewButton { + id: sliceButton + text: "Slice All Layers" + Layout.fillWidth: true + Layout.minimumHeight: 40 + onClicked: { + if (surfaceLayers.selectionMode & AbstractGraph3D.SelectionMultiSeries) { + surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow + | AbstractGraph3D.SelectionSlice + text = "Slice All Layers" + } else { + surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow + | AbstractGraph3D.SelectionSlice + | AbstractGraph3D.SelectionMultiSeries + text = "Slice One Layer" + } + } + } + //! [6] + + NewButton { + id: shadowButton + text: "Show Shadows" + Layout.fillWidth: true + Layout.minimumHeight: 40 + onClicked: { + if (surfaceLayers.shadowQuality === AbstractGraph3D.ShadowQualityNone) { + surfaceLayers.shadowQuality = AbstractGraph3D.ShadowQualityLow + text = "Hide Shadows" + } else { + surfaceLayers.shadowQuality = AbstractGraph3D.ShadowQualityNone + text = "Show Shadows" + } + } + } + } +} -- cgit v1.2.3 From 5bd455cbd04a61b251c466dd641e3ef31fcbe93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 18 Feb 2014 12:56:10 +0200 Subject: Crash fix Also fixes messing up the quick controls when switching between rendering modes. Change-Id: I8c383ee948b0ba363d09a93b35f14028702296d3 Reviewed-by: Miikka Heikkinen --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 22c527a2..65378660 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -230,5 +230,28 @@ Item { } } } + + NewButton { + id: aaButton + text: "Disable Antialiasing" + Layout.fillWidth: true + Layout.minimumHeight: 40 + visible: false + onClicked: { + if (surfaceLayers.renderingMode === AbstractGraph3D.Indirect_NoAA) { + surfaceLayers.renderingMode = AbstractGraph3D.DirectToBackground + text = "Disable Antialiasing" + } else { + surfaceLayers.renderingMode = AbstractGraph3D.Indirect_NoAA + text = "Enable Antialiasing" + } + } + } + + Component.onCompleted: { + if (surfaceLayers.antialiasing) { + aaButton.visible = true + } + } } } -- cgit v1.2.3 From 0e56c8f873e31bc0a8c7d5c0b954ec8d14f0495a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 18 Feb 2014 14:55:25 +0200 Subject: Fix scene coordinates in qml indirect rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +Rename enums +Remove unnecessary update loop +Fudge qmlmultigraphs example data so that shadows are not borked in bar graph +Remove unnecessary border from around buttons in qmlmultigraphs Change-Id: I6c24f33912d29b7954c82f17becd342aea66b0e1 Reviewed-by: Tomi Korpipää --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 65378660..2c425a57 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -238,11 +238,11 @@ Item { Layout.minimumHeight: 40 visible: false onClicked: { - if (surfaceLayers.renderingMode === AbstractGraph3D.Indirect_NoAA) { - surfaceLayers.renderingMode = AbstractGraph3D.DirectToBackground + if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect_NoAA) { + surfaceLayers.renderingMode = AbstractGraph3D.RenderDirectToBackground text = "Disable Antialiasing" } else { - surfaceLayers.renderingMode = AbstractGraph3D.Indirect_NoAA + surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect_NoAA text = "Enable Antialiasing" } } -- cgit v1.2.3 From 07e980e908c45c8d59a566a530e4ef9323aff08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Wed, 19 Feb 2014 09:02:01 +0200 Subject: Qmlsurfacelayers checkbox order changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib547cc541a450e15df36de34623d7042c8b69712 Change-Id: Ib547cc541a450e15df36de34623d7042c8b69712 Reviewed-by: Tomi Korpipää --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 2c425a57..8b802060 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -45,14 +45,14 @@ Item { ColorGradient { id: layerTwoGradient - ColorGradientStop { position: 0.0; color: "red" } - ColorGradientStop { position: 0.15; color: "black" } + ColorGradientStop { position: 0.315; color: "blue" } + ColorGradientStop { position: 0.33; color: "white" } } ColorGradient { id: layerThreeGradient - ColorGradientStop { position: 0.315; color: "blue" } - ColorGradientStop { position: 0.33; color: "white" } + ColorGradientStop { position: 0.0; color: "red" } + ColorGradientStop { position: 0.15; color: "black" } } //! [0] @@ -140,13 +140,13 @@ Item { CheckBox { id: layerTwoToggle - text: "Show Tectonic Layer" + text: "Show Sea Layer" checked: true } CheckBox { id: layerThreeToggle - text: "Show Sea Layer" + text: "Show Tectonic Layer" checked: true } } @@ -171,7 +171,7 @@ Item { CheckBox { id: layerTwoGrid - text: "Show Tectonic as Grid" + text: "Show Sea as Grid" onCheckedChanged: { if (checked) layerTwoSeries.drawMode = Surface3DSeries.DrawWireframe @@ -182,7 +182,7 @@ Item { CheckBox { id: layerThreeGrid - text: "Show Sea as Grid" + text: "Show Tectonic as Grid" onCheckedChanged: { if (checked) layerThreeSeries.drawMode = Surface3DSeries.DrawWireframe -- cgit v1.2.3 From aa542150122d975a1a6fc097a0ce4e2dd339528e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Wed, 19 Feb 2014 14:01:09 +0200 Subject: MSAA support added to QML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I64258705e4423b2762aeff28c3eafd6bdf5d34e9 Reviewed-by: Tomi Korpipää --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 36 +++++++++++++++------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 8b802060..bd68ff69 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -232,26 +232,40 @@ Item { } NewButton { - id: aaButton - text: "Disable Antialiasing" + id: renderModeButton + text: "Switch Render Mode" Layout.fillWidth: true Layout.minimumHeight: 40 - visible: false onClicked: { - if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect_NoAA) { + if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && + surfaceLayers.msaaSamples === 0) { surfaceLayers.renderingMode = AbstractGraph3D.RenderDirectToBackground - text = "Disable Antialiasing" + renderLabel.text = "Background, " + surfaceLayers.msaaSamples + "xMSAA" + } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && + surfaceLayers.msaaSamples === 4) { + surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect + surfaceLayers.msaaSamples = 0 + renderLabel.text = "Indirect, No AA" + } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && + surfaceLayers.msaaSamples === 8) { + surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect + surfaceLayers.msaaSamples = 4 + renderLabel.text = "Indirect, 4xMSAA" } else { - surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect_NoAA - text = "Enable Antialiasing" + surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect + surfaceLayers.msaaSamples = 8 + renderLabel.text = "Indirect, 8xMSAA" } } } - Component.onCompleted: { - if (surfaceLayers.antialiasing) { - aaButton.visible = true - } + TextField { + id: renderLabel + Layout.fillWidth: true + Layout.minimumHeight: 40 + enabled: false + horizontalAlignment: TextInput.AlignHCenter + text: "Indirect, 4xMSAA" } } } -- cgit v1.2.3 From 73e83d139481f87ec77db0f845b151b9f50d73bd Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 20 Feb 2014 14:55:33 +0200 Subject: Misc fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Rectangle used as main item in qml examples to make ui consistent + Surface autoaxis adjustment fixes for multiseries case + Qmlsurface example UI tweaks Change-Id: Ie75b0efc08f9a56ca709f079b28865e34caa8641 Reviewed-by: Tomi Korpipää --- .../datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index bd68ff69..2fe5f57a 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -22,7 +22,7 @@ import QtQuick.Controls 1.0 import QtDataVisualization 1.0 import "." -Item { +Rectangle { id: mainview width: 1280 height: 720 -- cgit v1.2.3 From 424bfe5881c38a346896c375dfafc4dce043f685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 21 Feb 2014 10:30:15 +0200 Subject: Re-enabled background rendering to qmlsurfacelayers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1530716751b44f1d9d4edd19d8862c186ac7fb3d Change-Id: I1530716751b44f1d9d4edd19d8862c186ac7fb3d Reviewed-by: Tomi Korpipää --- .../datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 2fe5f57a..bd68ff69 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -22,7 +22,7 @@ import QtQuick.Controls 1.0 import QtDataVisualization 1.0 import "." -Rectangle { +Item { id: mainview width: 1280 height: 720 -- cgit v1.2.3 From cd00c2eafa1744b7bc7d8e2b074a694325669558 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 21 Feb 2014 13:33:57 +0200 Subject: Fix qmlsurfacelayers render mode button for android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib9d042a3f1176b710bfafcb5da16856fb5c1bc7d Reviewed-by: Tomi Korpipää --- .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml') diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index bd68ff69..0be991bc 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -237,25 +237,32 @@ Item { Layout.fillWidth: true Layout.minimumHeight: 40 onClicked: { + var modeText = "Indirect " + var aaText if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && surfaceLayers.msaaSamples === 0) { surfaceLayers.renderingMode = AbstractGraph3D.RenderDirectToBackground - renderLabel.text = "Background, " + surfaceLayers.msaaSamples + "xMSAA" + modeText = "BackGround " } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && surfaceLayers.msaaSamples === 4) { surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect surfaceLayers.msaaSamples = 0 - renderLabel.text = "Indirect, No AA" } else if (surfaceLayers.renderingMode === AbstractGraph3D.RenderIndirect && surfaceLayers.msaaSamples === 8) { surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect surfaceLayers.msaaSamples = 4 - renderLabel.text = "Indirect, 4xMSAA" } else { surfaceLayers.renderingMode = AbstractGraph3D.RenderIndirect surfaceLayers.msaaSamples = 8 - renderLabel.text = "Indirect, 8xMSAA" } + + if (surfaceLayers.msaaSamples <= 0) { + aaText = "No AA" + } else { + aaText = surfaceLayers.msaaSamples + "xMSAA" + } + + renderLabel.text = modeText + aaText } } @@ -265,7 +272,7 @@ Item { Layout.minimumHeight: 40 enabled: false horizontalAlignment: TextInput.AlignHCenter - text: "Indirect, 4xMSAA" + text: "Indirect, " + surfaceLayers.msaaSamples + "xMSAA" } } } -- cgit v1.2.3