diff options
author | Määttä Antti <antti.maatta@qt.io> | 2018-01-11 16:04:51 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2018-01-12 13:14:22 +0000 |
commit | 72905889ea2e13fc1160491024e920e1e6507efd (patch) | |
tree | d4700bd8e5026ef30b9c46dba4f0604b4fef3ba6 | |
parent | 67cdd6829fa8dba46cc25a8850ea785be88040d5 (diff) |
Add tests for qml stream
Included are test for one qml stream, multiple qml streams at once and qml
stream in a layer.
Change-Id: I12413394b92ced0218e98d54645c0ab46901d272
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
18 files changed, 824 insertions, 0 deletions
diff --git a/tests/scenes/multipleqmlstreams/maps/dummy.png b/tests/scenes/multipleqmlstreams/maps/dummy.png Binary files differnew file mode 100644 index 0000000..6e40132 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/maps/dummy.png diff --git a/tests/scenes/multipleqmlstreams/multiplestreams.uia b/tests/scenes/multipleqmlstreams/multiplestreams.uia new file mode 100644 index 0000000..4352545 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/multiplestreams.uia @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<application> + <assets initial="multiplestreams"> + <presentation id="multiplestreams" src="multiplestreams.uip"/> + <presentation-qml id="left_layer" args=""/> + <presentation-qml id="right_layer" args=""/> + <presentation-qml id="left_rect" args="scripts\left_rect.qml"/> + <presentation-qml id="right_rect" args="scripts\right_rect.qml"/> + <presentation-qml id="cylinder" args="scripts\cylinder.qml"/> + </assets> + <statemachine ref="#logic"> + <visual-states> + <state ref="Initial"> + <enter> + <goto-slide element="main:Scene" rel="next"/> + </enter> + </state> + </visual-states> + </statemachine> +</application> diff --git a/tests/scenes/multipleqmlstreams/multiplestreams.uip b/tests/scenes/multipleqmlstreams/multiplestreams.uip new file mode 100644 index 0000000..f99f787 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/multiplestreams.uip @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="3" > + <Project > + <ProjectSettings author="" company="" presentationWidth="1200" presentationHeight="900" maintainAspect="False" > + <CustomColors count="16" >#ffffff #8f73a8 #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Rectangle" > + <Material id="Default" name="Default" > + <Image id="Default_diffusemap" /> + </Material> + </Model> + <Model id="Rectangle2" > + <Material id="Default_001" name="Default" > + <Image id="Default_001_diffusemap" /> + </Material> + </Model> + <Model id="Sphere" > + <Material id="Default_002" name="Default" > + <Image id="Default_002_diffusemap" /> + </Material> + </Model> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" /> + <Add ref="#Camera" /> + <Add ref="#Light" /> + <State id="Scene-Slide1" name="Slide1" > + <Add ref="#Rectangle" name="Rectangle" position="-229.528 170.639 0" rotation="-23.5 -56.5 9.3099e-07" scale="3.92002 2.2675 1.325" sourcepath="#Rectangle" /> + <Add ref="#Default" diffusemap="#Default_diffusemap" /> + <Add ref="#Default_diffusemap" sourcepath="maps/dummy.png" subpresentation="left_rect" /> + <Add ref="#Rectangle2" name="Rectangle2" position="347.828 230.555 0" rotation="-30.7742 70.8761 -5.83502" scale="1.69284 1.71606 1.99829" sourcepath="#Rectangle" /> + <Add ref="#Default_001" diffusemap="#Default_001_diffusemap" /> + <Add ref="#Default_001_diffusemap" sourcepath="maps/dummy.png" subpresentation="right_rect" /> + <Add ref="#Sphere" name="Sphere" scale="3 3 3" sourcepath="#Sphere" /> + <Add ref="#Default_002" diffusemap="#Default_002_diffusemap" /> + <Add ref="#Default_002_diffusemap" sourcepath="maps/dummy.png" subpresentation="cylinder" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/tests/scenes/multipleqmlstreams/scripts/cylinder.qml b/tests/scenes/multipleqmlstreams/scripts/cylinder.qml new file mode 100644 index 0000000..8bcd447 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/scripts/cylinder.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 +import QtQuick.Particles 2.0 + +Rectangle { + width: 1024 + height: 1024 + + color: "black" + + ParticleSystem { + anchors.fill: parent + ImageParticle { + groups: ["stars"] + anchors.fill: parent + source: "star.png" + } + Emitter { + group: "stars" + emitRate: 800 + lifeSpan: 2400 + size: 24 + sizeVariation: 8 + anchors.fill: parent + velocity: PointDirection { x: 10; xVariation: 2; y: 0; yVariation: 2} + } + + // ![0] + ImageParticle { + anchors.fill: parent + source: "star.png" + alpha: 0 + alphaVariation: 0.2 + colorVariation: 1.0 + } + // ![0] + + Emitter { + anchors.centerIn: parent + emitRate: 400 + lifeSpan: 2400 + size: 48 + sizeVariation: 8 + velocity: AngleDirection {angleVariation: 180; magnitude: 60} + } + + Turbulence { + anchors.fill: parent + strength: 2 + } + } +} diff --git a/tests/scenes/multipleqmlstreams/scripts/left_rect.qml b/tests/scenes/multipleqmlstreams/scripts/left_rect.qml new file mode 100644 index 0000000..6f28ff3 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/scripts/left_rect.qml @@ -0,0 +1,244 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 + +Rectangle { + width: 1024 + height: 512 + color: "black" + property int lines: 166 + + Text { + id: text + x: 10 + y: 0 + color: "white" + + font.pointSize: 16 + text: "import QtQuick 2.7 +import QtStudio3D 1.0 + +Item { + id: mainview + width: 1280 + height: 768 + visible: true + + // Qt 3D Studio element + // + // The presentation displayed in this example consists of three simple slides with ping-pong + // animations: + // + // Slide 1: Move ball to the right side of the screen + // Slide 2: Move ball to center of the screen and scale it up + // Slide 3: Move ball back to the initial position on the left side of the screen + // + // Because the animations in the presentation are defined dynamic, the current position + // and scale of the ball are used as the initial keyframes for animations whenever + // a slide is changed. + Studio3D { + id: studio3D + anchors.fill: parent + + // ViewerSettings item is used to specify presentation independent viewer settings. + ViewerSettings { + scaleMode: ViewerSettings.ScaleModeFill + showRenderStats: false + } + + // Presentation item is used to control the presentation. + Presentation { + source: \"qrc:/presentation/dyn_key.uip\" + + // SceneElement item is used to listen for slide changes of a scene in the presentation. + // You can also change the slides via its properties. + SceneElement { + id: scene + elementPath: \"Scene\" + onCurrentSlideIndexChanged: { + console.log(\"Current slide : \" + currentSlideIndex + \" (\" + + currentSlideName + \")\"); + } + onPreviousSlideIndexChanged: { + console.log(\"Previous slide: \" + previousSlideIndex + \" (\" + + previousSlideName + \")\"); + } + } + + // Element item is used to change element attributes + Element { + id: materialElement + elementPath: \"Scene.Layer.Sphere.Material\" + } + + property int desiredSlideIndex: 1 + property int colorIndex: 0 + property var colorArray: [ + [1.0, 1.0, 1.0], + [1.0, 0.0, 0.0], + [0.0, 1.0, 0.0], + [0.0, 0.0, 1.0], + [0.0, 1.0, 1.0], + [1.0, 0.0, 1.0], + [1.0, 1.0, 0.0] + ] + + function nextSlide() { + // Separate desiredSlideIndex variable is used to keep track of the desired slide, + // because SceneElement's currentSlideIndex property works asynchronously. + // This way the button click always changes the slide even if you click + // it twice during the same frame. + desiredSlideIndex = desiredSlideIndex != 3 ? desiredSlideIndex + 1 : 1; + scene.currentSlideIndex = desiredSlideIndex + slideButtonText.text = \"Change Slide (\" + desiredSlideIndex + \")\" + } + + function resetTime() { + scene.goToTime(0); + } + + function changeColor() { + colorIndex = colorIndex >= colorArray.length - 1 ? colorIndex = 0 : colorIndex + 1; + materialElement.setAttribute(\"diffuse.r\", colorArray[colorIndex][0]); + materialElement.setAttribute(\"diffuse.g\", colorArray[colorIndex][1]); + materialElement.setAttribute(\"diffuse.b\", colorArray[colorIndex][2]); + changeColorButton.color = Qt.rgba(colorArray[colorIndex][0], + colorArray[colorIndex][1], + colorArray[colorIndex][2], 1.0); + } + } + onRunningChanged: console.log(\"Presentation running\") + } + + // Some buttons to control the scene + Rectangle { + id: slideButton + anchors.left: parent.left + anchors.top: parent.top + width: 200 + height: 50 + border.color: \"red\" + border.width: 3 + color: \"white\" + Text { + id: slideButtonText + anchors.fill: parent + text: \"Change Slide (1)\" + font.pointSize: 16 + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + } + MouseArea { + anchors.fill: parent + onClicked: { + studio3D.presentation.nextSlide(); + } + } + } + Rectangle { + id: resetTimeButton + anchors.left: parent.left + anchors.top: slideButton.bottom + width: 200 + height: 50 + border.color: \"red\" + border.width: 3 + color: \"white\" + Text { + anchors.fill: parent + text: \"Reset Time\" + font.pointSize: 16 + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + } + MouseArea { + anchors.fill: parent + onClicked: { + studio3D.presentation.resetTime(); + } + } + } + Rectangle { + id: changeColorButton + anchors.left: parent.left + anchors.top: resetTimeButton.bottom + width: 200 + height: 50 + border.color: \"red\" + border.width: 3 + color: \"white\" + Text { + anchors.fill: parent + text: \"Change Color\" + font.pointSize: 16 + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + } + MouseArea { + anchors.fill: parent + onClicked: { + studio3D.presentation.changeColor(); + } + } + } +}" + } + + PropertyAnimation { + target: text + property: "y" + from: 0 + to: (lines-27) * -16 + duration: lines * 600 + loops: Animation.Infinite + running: true + } +} diff --git a/tests/scenes/multipleqmlstreams/scripts/qtlogo.png b/tests/scenes/multipleqmlstreams/scripts/qtlogo.png Binary files differnew file mode 100644 index 0000000..f7276e2 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/scripts/qtlogo.png diff --git a/tests/scenes/multipleqmlstreams/scripts/right_rect.qml b/tests/scenes/multipleqmlstreams/scripts/right_rect.qml new file mode 100644 index 0000000..129ad3b --- /dev/null +++ b/tests/scenes/multipleqmlstreams/scripts/right_rect.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 + +Rectangle { + width: 512 + height: 512 + + Image { + id: image + width: parent.width + height: parent.height + source: "qtlogo.png" + + SequentialAnimation { + running: true + loops: SequentialAnimation.Infinite + NumberAnimation { id: begin; target: image; property: "rotation"; from: -20; to: 20; duration: 600 } + NumberAnimation { id: end; target: image; property: "rotation"; from: 20; to: -20; duration: 600 } + } + } +} diff --git a/tests/scenes/multipleqmlstreams/scripts/star.png b/tests/scenes/multipleqmlstreams/scripts/star.png Binary files differnew file mode 100644 index 0000000..bdcd369 --- /dev/null +++ b/tests/scenes/multipleqmlstreams/scripts/star.png diff --git a/tests/scenes/qmlstream/images/dummy.png b/tests/scenes/qmlstream/images/dummy.png Binary files differnew file mode 100644 index 0000000..6e40132 --- /dev/null +++ b/tests/scenes/qmlstream/images/dummy.png diff --git a/tests/scenes/qmlstream/qmlstream.uia b/tests/scenes/qmlstream/qmlstream.uia new file mode 100644 index 0000000..7555d78 --- /dev/null +++ b/tests/scenes/qmlstream/qmlstream.uia @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<application xmlns="http://qt.io/qt3dstudio/uia"> + <assets initial="qmlstream"> + <presentation id="qmlstream" src="qmlstream.uip"/> + <presentation-qml id="red-fill" args="scripts/RedFill.qml" /> + </assets> +</application> diff --git a/tests/scenes/qmlstream/qmlstream.uip b/tests/scenes/qmlstream/qmlstream.uip new file mode 100644 index 0000000..322177a --- /dev/null +++ b/tests/scenes/qmlstream/qmlstream.uip @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="3" > + <Project > + <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" /> + <Graph > + <Scene id="Scene" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Cube" > + <Material id="Material" > + <Image id="Material_diffusemap" /> + </Material> + </Model> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" endtime="2000" /> + <Add ref="#Camera" endtime="2000" /> + <Add ref="#Light" endtime="2000" /> + <State id="Scene-Rotating_Cube" name="Rotating_Cube" playmode="PingPong" > + <Set ref="#Layer" endtime="2000" /> + <Set ref="#Camera" endtime="2000" /> + <Set ref="#Light" endtime="2000" /> + <Add ref="#Cube" name="Cube" endtime="2000" position="-349.297 168.875 0" sourcepath="#Cube" > + <AnimationTrack property="position.x" type="EaseInOut" >0 -349.297 100 100 2 334.863 100 100</AnimationTrack> + <AnimationTrack property="position.y" type="EaseInOut" >0 168.875 100 100 2 -160.215 100 100</AnimationTrack> + <AnimationTrack property="position.z" type="EaseInOut" >0 0 100 100 2 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 2 -16.4917 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 2 -154.887 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 2 270.405 100 100</AnimationTrack> + </Add> + <Add ref="#Material" diffuse="1 1 1" diffusemap="#Material_diffusemap" /> + <Add ref="#Material_diffusemap" sourcepath=".\images\dummy.png" subpresentation="red-fill" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/tests/scenes/qmlstream/scripts/RedFill.qml b/tests/scenes/qmlstream/scripts/RedFill.qml new file mode 100644 index 0000000..3d39fb4 --- /dev/null +++ b/tests/scenes/qmlstream/scripts/RedFill.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 + +Rectangle { + width: 1024 + height: 512 + color: "white" + + Rectangle { + id: rectangle + x: 0 + y: 0 + width: 0 + height: 512 + color: "red" + } + Text { + anchors.fill: parent + text: "QML" + font.pixelSize: 200 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + PropertyAnimation { + target: rectangle + property: "width" + from: 0 + to: 1024 + duration: 3000 + loops: Animation.Infinite + running: true + } +} diff --git a/tests/scenes/qmlstreamlayer/images/dummy.png b/tests/scenes/qmlstreamlayer/images/dummy.png Binary files differnew file mode 100644 index 0000000..6e40132 --- /dev/null +++ b/tests/scenes/qmlstreamlayer/images/dummy.png diff --git a/tests/scenes/qmlstreamlayer/qmlstreamlayer.uia b/tests/scenes/qmlstreamlayer/qmlstreamlayer.uia new file mode 100644 index 0000000..5caf44b --- /dev/null +++ b/tests/scenes/qmlstreamlayer/qmlstreamlayer.uia @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<application> + <assets initial="qmlstreamlayer"> + <presentation id="qmlstreamlayer" src="qmlstreamlayer.uip"/> + <presentation-qml id="red-fill" args="scripts/RedFill.qml"/> + <presentation-qml id="layer" args="scripts\right_rect.qml"/> + </assets> +</application> diff --git a/tests/scenes/qmlstreamlayer/qmlstreamlayer.uip b/tests/scenes/qmlstreamlayer/qmlstreamlayer.uip new file mode 100644 index 0000000..4261907 --- /dev/null +++ b/tests/scenes/qmlstreamlayer/qmlstreamlayer.uip @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="3" > + <Project > + <ProjectSettings author="" company="" presentationWidth="1200" presentationHeight="800" maintainAspect="False" > + <CustomColors count="16" >#ffffff #8f73a8 #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene" > + <Layer id="qmlstream" > + <Camera id="Camera_001" /> + <Light id="Light_001" /> + </Layer> + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Cube" > + <Material id="Material" > + <Image id="Material_diffusemap" /> + </Material> + </Model> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" endtime="2000" /> + <Add ref="#Camera" endtime="2000" /> + <Add ref="#Light" endtime="2000" /> + <State id="Scene-Rotating_Cube" name="Rotating_Cube" playmode="PingPong" > + <Set ref="#Layer" endtime="2000" /> + <Set ref="#Camera" endtime="2000" /> + <Set ref="#Light" endtime="2000" /> + <Add ref="#qmlstream" name="qmlstream" endtime="2000" height="512" heightunits="pixels" left="0" sourcepath="layer" top="288" topunits="pixels" width="512" widthunits="pixels" /> + <Add ref="#Camera_001" endtime="2000" /> + <Add ref="#Light_001" endtime="2000" /> + <Add ref="#Cube" name="Cube" endtime="2000" position="-349.297 168.875 0" sourcepath="#Cube" > + <AnimationTrack property="position.x" type="EaseInOut" >0 -349.297 100 100 2 334.863 100 100</AnimationTrack> + <AnimationTrack property="position.y" type="EaseInOut" >0 168.875 100 100 2 -160.215 100 100</AnimationTrack> + <AnimationTrack property="position.z" type="EaseInOut" >0 0 100 100 2 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 2 -16.4917 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 2 -154.887 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 2 270.405 100 100</AnimationTrack> + </Add> + <Add ref="#Material" diffuse="1 1 1" diffusemap="#Material_diffusemap" /> + <Add ref="#Material_diffusemap" sourcepath=".\images\dummy.png" subpresentation="red-fill" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/tests/scenes/qmlstreamlayer/scripts/RedFill.qml b/tests/scenes/qmlstreamlayer/scripts/RedFill.qml new file mode 100644 index 0000000..3d39fb4 --- /dev/null +++ b/tests/scenes/qmlstreamlayer/scripts/RedFill.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 + +Rectangle { + width: 1024 + height: 512 + color: "white" + + Rectangle { + id: rectangle + x: 0 + y: 0 + width: 0 + height: 512 + color: "red" + } + Text { + anchors.fill: parent + text: "QML" + font.pixelSize: 200 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + PropertyAnimation { + target: rectangle + property: "width" + from: 0 + to: 1024 + duration: 3000 + loops: Animation.Infinite + running: true + } +} diff --git a/tests/scenes/qmlstreamlayer/scripts/qtlogo.png b/tests/scenes/qmlstreamlayer/scripts/qtlogo.png Binary files differnew file mode 100644 index 0000000..f7276e2 --- /dev/null +++ b/tests/scenes/qmlstreamlayer/scripts/qtlogo.png diff --git a/tests/scenes/qmlstreamlayer/scripts/right_rect.qml b/tests/scenes/qmlstreamlayer/scripts/right_rect.qml new file mode 100644 index 0000000..129ad3b --- /dev/null +++ b/tests/scenes/qmlstreamlayer/scripts/right_rect.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.7 + +Rectangle { + width: 512 + height: 512 + + Image { + id: image + width: parent.width + height: parent.height + source: "qtlogo.png" + + SequentialAnimation { + running: true + loops: SequentialAnimation.Infinite + NumberAnimation { id: begin; target: image; property: "rotation"; from: -20; to: 20; duration: 600 } + NumberAnimation { id: end; target: image; property: "rotation"; from: 20; to: -20; duration: 600 } + } + } +} |