summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-10-20 15:12:15 +0100
committerPaul Lemire <paul.lemire@kdab.com>2020-10-28 16:51:29 +0100
commitf5f6a5ccbd451974e0bae4ce220dca160b1760c4 (patch)
tree11e7acf6d4e2ebd26a6a339b04c82e2541418bef /examples
parent6fa65e303520003fcb894a25652457d67de5ad94 (diff)
Finish removing traces of Scene3DView
Change-Id: I450e53cc716235db1bc0675c904466050e17296d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/CMakeLists.txt1
-rw-r--r--examples/qt3d/qt3d.pro1
-rw-r--r--examples/qt3d/scene3dview/AnimatedEntity.qml143
-rw-r--r--examples/qt3d/scene3dview/CMakeLists.txt53
-rw-r--r--examples/qt3d/scene3dview/doc/images/scene3dview.pngbin28772 -> 0 bytes
-rw-r--r--examples/qt3d/scene3dview/doc/src/scene3dview.qdoc62
-rw-r--r--examples/qt3d/scene3dview/main.cpp67
-rw-r--r--examples/qt3d/scene3dview/main.qml142
-rw-r--r--examples/qt3d/scene3dview/scene3dview.pro15
-rw-r--r--examples/qt3d/scene3dview/scene3dview.qrc6
10 files changed, 0 insertions, 490 deletions
diff --git a/examples/qt3d/CMakeLists.txt b/examples/qt3d/CMakeLists.txt
index 052309345..49209c259 100644
--- a/examples/qt3d/CMakeLists.txt
+++ b/examples/qt3d/CMakeLists.txt
@@ -18,7 +18,6 @@ if(TARGET Qt::Quick)
add_subdirectory(planets-qml)
add_subdirectory(scene2d)
add_subdirectory(scene3d)
- add_subdirectory(scene3dview)
add_subdirectory(simple-qml)
add_subdirectory(simplecustommaterial)
add_subdirectory(wave)
diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro
index 52ae5389c..c309615e2 100644
--- a/examples/qt3d/qt3d.pro
+++ b/examples/qt3d/qt3d.pro
@@ -30,7 +30,6 @@ qtHaveModule(quick) {
compute-particles \
phong-cubes \
lights \
- scene3dview \
controlsunderlay \
simplecustommaterial \
qardboard \
diff --git a/examples/qt3d/scene3dview/AnimatedEntity.qml b/examples/qt3d/scene3dview/AnimatedEntity.qml
deleted file mode 100644
index db27f3584..000000000
--- a/examples/qt3d/scene3dview/AnimatedEntity.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt3D.Core 2.14
-import Qt3D.Render 2.14
-import Qt3D.Input 2.14
-import Qt3D.Extras 2.14
-
-import QtQuick 2.14 as QQ2
-
-
-Entity {
- id: sceneRoot
- property color sceneColor
- property bool clearColor: true
-
- Camera {
- id: camera
- projectionType: CameraLens.PerspectiveProjection
- fieldOfView: 45
- nearPlane : 0.1
- farPlane : 1000.0
- position: Qt.vector3d( 0.0, 0.0, 40.0 )
- upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
- viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
- }
-
- FirstPersonCameraController { camera: camera }
-
- components: [
- RenderSettings {
- activeFrameGraph: ForwardRenderer {
- camera: camera
- clearColor: "transparent"
- buffersToClear: sceneRoot.clearColor ? ClearBuffers.ColorDepthBuffer : ClearBuffers.DepthBuffer
- }
- },
- InputSettings { }
- ]
-
- PhongMaterial {
- id: material
- diffuse: sceneColor
- }
-
- TorusMesh {
- id: torusMesh
- radius: 5
- minorRadius: 1
- rings: 100
- slices: 20
- }
-
- Transform {
- id: torusTransform
- scale3D: Qt.vector3d(1.5, 1, 0.5)
- rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
- }
-
- Entity {
- id: torusEntity
- components: [ torusMesh, material, torusTransform ]
- }
-
- SphereMesh {
- id: sphereMesh
- radius: 3
- }
-
- Transform {
- id: sphereTransform
- property real userAngle: 0.0
- matrix: {
- var m = Qt.matrix4x4();
- m.rotate(userAngle, Qt.vector3d(0, 1, 0))
- m.translate(Qt.vector3d(20, 0, 0));
- return m;
- }
- }
-
- QQ2.NumberAnimation {
- target: sphereTransform
- property: "userAngle"
- duration: 10000
- from: 0
- to: 360
-
- loops: QQ2.Animation.Infinite
- running: true
- }
-
- Entity {
- id: sphereEntity
- components: [ sphereMesh, material, sphereTransform ]
- }
-}
diff --git a/examples/qt3d/scene3dview/CMakeLists.txt b/examples/qt3d/scene3dview/CMakeLists.txt
deleted file mode 100644
index e3b1b9d6d..000000000
--- a/examples/qt3d/scene3dview/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-# Generated from scene3dview.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(scene3dview 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 3DInput)
-
-qt_add_executable(scene3dview
- main.cpp
-)
-target_link_libraries(scene3dview PUBLIC
- Qt::3DInput
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
-)
-
-
-# Resources:
-set(scene3dview_resource_files
- "AnimatedEntity.qml"
- "main.qml"
-)
-
-qt6_add_resources(scene3dview "scene3dview"
- PREFIX
- "/"
- FILES
- ${scene3dview_resource_files}
-)
-
-install(TARGETS scene3dview
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/qt3d/scene3dview/doc/images/scene3dview.png b/examples/qt3d/scene3dview/doc/images/scene3dview.png
deleted file mode 100644
index d697d1850..000000000
--- a/examples/qt3d/scene3dview/doc/images/scene3dview.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/scene3dview/doc/src/scene3dview.qdoc b/examples/qt3d/scene3dview/doc/src/scene3dview.qdoc
deleted file mode 100644
index 721929350..000000000
--- a/examples/qt3d/scene3dview/doc/src/scene3dview.qdoc
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example scene3dview
- \title Qt 3D: Scene3DView QML Example
- \ingroup qt3d-examples-qml
- \brief A QML application that demonstrates visualizing multiple 3D scenes
- using Scene3D and Scene3DView.
-
- \image scene3dview.png
-
- This example demonstrates visualizing multiple 3D scenes from a Qt Quick
- application usinc Scene3D and Scene3DView. Each 3D scene contains a single
- active camera and a single active light source. Visualized data is assumed
- to be at a fixed location.
-
- \include examples-run.qdocinc
-
- \section1 Visualizing 3D Scenes
-
- First we set up a Scene3D instance that will be required for our
- Scene3DView instanced.
-
- \snippet scene3dview/main.qml 0
-
- Then we instanciate our Scene3DView instances and make them reference the
- Scene3D. We also provide a root Entity for each Scene3DView with a \e
- scene3dview/AnimatedEntity.qml.
-
- \snippet scene3dview/main.qml 1
-
- Care has to be taken that only the first Scene3DView clears the color
- buffer. We don't want each Scene3DView to clear the screen as that would
- erase content for all but the last Scene3DView.
-
- \snippet scene3dview/main.qml 1.1
-*/
diff --git a/examples/qt3d/scene3dview/main.cpp b/examples/qt3d/scene3dview/main.cpp
deleted file mode 100644
index e04bbc050..000000000
--- a/examples/qt3d/scene3dview/main.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QGuiApplication>
-#include <QQuickView>
-
-int main(int argc, char **argv)
-{
- QGuiApplication app(argc, argv);
-
- QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
- QQuickView view;
-
- view.resize(500, 500);
- view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl("qrc:/main.qml"));
- view.show();
-
- return app.exec();
-}
diff --git a/examples/qt3d/scene3dview/main.qml b/examples/qt3d/scene3dview/main.qml
deleted file mode 100644
index d2a3fc3e0..000000000
--- a/examples/qt3d/scene3dview/main.qml
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.14
-import QtQuick.Scene3D 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Layouts 1.14
-
-Item {
-
- //! [0]
- Scene3D {
- id: scene3dInstance
- anchors.fill: parent
- focus: true
- aspects: ["input", "logic"]
- cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
- multisample: true
- }
- //! [0]
-
- ColumnLayout {
- anchors.fill: parent
- Grid {
- id: grid
- Layout.fillWidth: true
- Layout.fillHeight: true
- columns: 2
- rows: 2
- spacing: 50
-
- readonly property int cellWidth: (width - spacing ) * 0.5
- readonly property int cellHeight: (height -spacing) * 0.5
- readonly property var colors: ["green", "gray", "orange", "blue"]
- readonly property int maxInstances: grid.rows * grid.columns
-
- Repeater {
- id: gridRepeater
- model: grid.rows * grid.columns
-
- //! [1]
- Rectangle {
- width: grid.cellWidth
- height: grid.cellHeight
- color: "darkRed"
- scale: ma.pressed || ma.containsMouse ? 0.8 : 1
- Behavior on scale { NumberAnimation { duration: 750 } }
-
- Scene3DView {
- onXChanged: console.log(("X (%1): %2").arg(model.index).arg(x))
- scene3D: scene3dInstance
- anchors.fill: parent
- AnimatedEntity {
- sceneColor: grid.colors[model.index]
- //! [1.1]
- // Only clear the color for the first Scene3DView
- clearColor: model.index === 0
- //! [1.1]
- }
- }
- Text {
- anchors {
- horizontalCenter: parent.horizontalCenter
- bottom: parent.bottom
- }
-
- color: "white"
- font.bold: true
- text: "Scene3DView " + (model.index + 1)
- }
-
- MouseArea {
- id: ma
- anchors.fill: parent
- hoverEnabled: true
- }
- }
- //! [1]
- }
- }
-
- RowLayout {
- Layout.alignment: Qt.AlignHCenter
- Button {
- text: "-"
- onClicked: gridRepeater.model = Math.max(1, gridRepeater.count - 1);
- }
- Text { text: "Instances (%1/%2)".arg(gridRepeater.count).arg(grid.maxInstances) }
- Button {
- text: "+"
- onClicked: gridRepeater.model = Math.min(grid.maxInstances, gridRepeater.count + 1);
- }
- }
- }
-}
diff --git a/examples/qt3d/scene3dview/scene3dview.pro b/examples/qt3d/scene3dview/scene3dview.pro
deleted file mode 100644
index 4e1052b7b..000000000
--- a/examples/qt3d/scene3dview/scene3dview.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-!include( ../examples.pri ) {
- error( "Couldn't find the examples.pri file!" )
-}
-
-QT += qml quick 3dinput
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- AnimatedEntity.qml \
- main.qml
-
-RESOURCES += \
- scene3dview.qrc
diff --git a/examples/qt3d/scene3dview/scene3dview.qrc b/examples/qt3d/scene3dview/scene3dview.qrc
deleted file mode 100644
index dff72ed5a..000000000
--- a/examples/qt3d/scene3dview/scene3dview.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>AnimatedEntity.qml</file>
- <file>main.qml</file>
- </qresource>
-</RCC>