Debian Codegraph @

tests/manual/compute-particles/main.qml

raw
1 // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQuick 2.0
5 import QtQuick.Scene3D 2.0
6 import QtQuick.Controls 2.0
7 import QtQuick.Layouts 1.1
8
9 Item {
10
11 Scene3D {
12 anchors.fill: parent
13 aspects: "input"
14 ParticlesScene {
15 id: scene
16 particleStep: stepSlider.value
17 finalCollisionFactor: collisionSlider.value
18 }
19 }
20
21 ColumnLayout {
22 id: colorLayout
23 anchors.left: parent.left
24 anchors.leftMargin: 35
25 anchors.right: parent.right
26 anchors.rightMargin: 35
27 anchors.bottom: parent.bottom
28 anchors.bottomMargin: 35
29 spacing: 15
30
31 RowLayout {
32 Text {
33 text: "Particles Step:"
34 color: "white"
35 }
36 Slider {
37 height: 35
38 id: stepSlider
39 Layout.fillWidth: true
40 from: 0.0
41 to: 2
42 value: 0.4
43 }
44 }
45 RowLayout {
46 Text {
47 text: "Particles Collision:"
48 color: "white"
49 }
50 Slider {
51 height: 35
52 id: collisionSlider
53 Layout.fillWidth: true
54 from: 0.0
55 to: 2
56 value: 0.2
57 }
58 }
59 RowLayout {
60 Button {
61 text: "Reset Particles"
62 onClicked: scene.reset()
63 }
64 }
65 RowLayout {
66 Text {
67 text: "Particles Shape:"
68 color: "white"
69 }
70 ButtonGroup {
71 exclusive: true
72 id: particlesTypeGroup
73 }
74 CheckBox {
75 text: "Sphere"
76 checked: true
77 ButtonGroup.group: particlesTypeGroup
78 onClicked: scene.particlesShape = scene._SPHERE
79 }
80 CheckBox
81 { text: "Cube"
82 checked: false
83 ButtonGroup.group: particlesTypeGroup
84 onClicked: scene.particlesShape = scene._CUBE
85 }
86 CheckBox {
87 text: "Cylinder"
88 checked: false
89 ButtonGroup.group: particlesTypeGroup
90 onClicked: scene.particlesShape = scene._CYLINDER
91 }
92 CheckBox {
93 text: "Torus"
94 checked: false
95 ButtonGroup.group: particlesTypeGroup
96 onClicked: scene.particlesShape = scene._TORUS
97 }
98 }
99 }
100 }