summaryrefslogtreecommitdiffstats
path: root/tests/manual/compute-manual/main.qml
blob: 875672bd580588d767e715bf763046047bc7f9ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick 2.14
import QtQuick.Scene3D 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.1
import Qt3D.Render 2.14

Item {

    Scene3D {
        anchors.fill: parent
        aspects: ["input", "logic"]
        focus: true
        ParticlesScene {
            id: scene
            computeMode: runModeCombo.currentIndex === 0 ? ComputeCommand.Continuous : ComputeCommand.Manual
        }
    }

    RowLayout {
        id: colorLayout
        anchors.left: parent.left
        anchors.leftMargin: 35
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 35
        spacing: 15

        RowLayout {
            Text {
                text: "Run Mode:"
                color: "white"
            }
            ComboBox {
                id: runModeCombo
                model: ["Continuous", "Manual"]
            }
        }
        RowLayout {
            visible: runModeCombo.currentIndex === 1
            Text {
                color: "white"
                text: "Frames"
            }
            SpinBox {
                id: frameCountSpinBox
                value: 5
                from: 1
                to: 10
                stepSize: 1
            }
            Button {
                text: "Trigger"
                onClicked: {
                    // Trigger Compute Manual
                    scene.triggerCompute(frameCountSpinBox.value)
                }
            }
        }
    }
}