diff options
author | dpope <[email protected]> | 2012-02-03 15:45:25 +1000 |
---|---|---|
committer | Rohan McGovern <[email protected]> | 2012-02-10 07:24:48 +0100 |
commit | bc66ec0bc5f548a72d21557d529f2d03c7417f09 (patch) | |
tree | 53aa0444fc698cde712fb8e0486e3da1a56f853d /tests/manual/translation | |
parent | 98451b5e136af38b00b008ae58ec8243c981eee4 (diff) |
Change-Id: I271146636615ab16f79ad3e66985076e2bd7a95c
Reviewed-by: Sarah Jane Smith <[email protected]>
Diffstat (limited to 'tests/manual/translation')
-rw-r--r-- | tests/manual/translation/README | 1 | ||||
-rw-r--r-- | tests/manual/translation/main.cpp | 63 | ||||
-rw-r--r-- | tests/manual/translation/qml/AxesVsVectorTestCase.qml | 155 | ||||
-rw-r--r-- | tests/manual/translation/qml/TranslationTestCase.qml | 110 | ||||
-rw-r--r-- | tests/manual/translation/qml/TranslationVectorTestCase.qml | 114 | ||||
-rw-r--r-- | tests/manual/translation/qml/tst_translation.qml | 158 | ||||
-rw-r--r-- | tests/manual/translation/qtquick3d.png | bin | 4050 -> 0 bytes | |||
-rw-r--r-- | tests/manual/translation/translation.pro | 10 | ||||
-rw-r--r-- | tests/manual/translation/tst_translation_qml.desktop | 7 |
9 files changed, 0 insertions, 618 deletions
diff --git a/tests/manual/translation/README b/tests/manual/translation/README deleted file mode 100644 index bbffedd5..00000000 --- a/tests/manual/translation/README +++ /dev/null @@ -1 +0,0 @@ -The "One teapot" test is ensuring that the two different ways of specifying position (x,y,z vs position) both have the same result. Two teapots are being rendered. To pass, the two teapots should be rendered in exactly the same position, so it looks like only one teapot. This test fails if the teapots are not aligned - e.g. there are two spouts, or the teapot is distorted. diff --git a/tests/manual/translation/main.cpp b/tests/manual/translation/main.cpp deleted file mode 100644 index 2755fd86..00000000 --- a/tests/manual/translation/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui/QApplication> -#include "qdeclarativeview3d.h" - -#include "../../shared/qmlres.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QDeclarativeView3D view; - QString qml = q_get_qmldir(QLatin1String("qml/tst_translation.qml")); - view.setSource(QUrl::fromLocalFile(qml)); - - if (QApplication::arguments().contains(QLatin1String("-maximize"))) - view.showMaximized(); - else if (QApplication::arguments().contains(QLatin1String("-fullscreen"))) - view.showFullScreen(); - else - view.show(); - - return app.exec(); -} diff --git a/tests/manual/translation/qml/AxesVsVectorTestCase.qml b/tests/manual/translation/qml/AxesVsVectorTestCase.qml deleted file mode 100644 index c5357322..00000000 --- a/tests/manual/translation/qml/AxesVsVectorTestCase.qml +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -Rectangle { - id: container - // Parameters for editting - property string text; - property variant translationVectorA: Qt.vector3d(1,1,1) - property variant translationVectorB: Qt.vector3d(1,1,1) - property variant camera: defaultCamera - property real itemX: 0 - property real itemY: 0 - property real itemZ: 0 - property int animationDuration: 2000 - - // Default values: - property variant defaultCamera: Camera {eye: Qt.vector3d(0,5,30)} - property real defaultWidth: 220 - property real defaultHeight: 150 - property variant itemPosition: - Qt.vector3d((translationVectorB.x * animationFactor + - translationVectorA.x * (1.0 - animationFactor)), - translationVectorB.y * animationFactor + - translationVectorA.y * (1.0 - animationFactor), - translationVectorB.z * animationFactor + - translationVectorA.z * (1.0 - animationFactor)) - property real animationFactor: 0.0 - - SequentialAnimation on animationFactor { - loops: Animation.Infinite - PropertyAnimation { - from: 0.0 - to: 1.0 - duration: animationDuration - } - } - - border.width: 2 - border.color: "black" - radius: 5 - width: defaultWidth - height: defaultHeight - - Text { - id: textItem - wrapMode: "WordWrap" - horizontalAlignment: "AlignHCenter" - text: container.text - anchors.left: parent.left - anchors.right: parent.right - } - - Rectangle { - id: viewportContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 1 - anchors.topMargin: 2 - anchors.top: textItem.bottom - anchors.bottom: container.bottom - color: "#aaccee" - - Viewport { - id: view - anchors.fill: parent - picking: true - camera: container.camera - - Material { - // Distinctive red Color - id: red - ambientColor: "#884422" - diffuseColor: "#EE4422" - specularColor: "#FF6644" - shininess: 200 - } - - Material { - // Distinctive blue Color - id: blue - ambientColor: "#224488" - diffuseColor: "#2244EE" - specularColor: "#4466FF" - shininess: 200 - } - - Effect { - id: redEffect; material: red - objectName: "redEffect" - } - - Effect { - id: blueEffect; material: blue - objectName: "blueEffect" - } - - Teapot - { - id: vectorModel -// effect: redEffect - position: itemPosition - } - Teapot - { - id: axesModel -// effect: blueEffect - x: itemX - y: itemY - z: itemZ - } - } - } -} diff --git a/tests/manual/translation/qml/TranslationTestCase.qml b/tests/manual/translation/qml/TranslationTestCase.qml deleted file mode 100644 index 9526cc1e..00000000 --- a/tests/manual/translation/qml/TranslationTestCase.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -Rectangle { - id: container - // Parameters for editting - property string text; - property real itemX: 0 - property real itemY: 0 - property real itemZ: 0 - property variant camera: defaultCamera - - // Default values: - property variant defaultCamera: Camera { eye: Qt.vector3d(0,5,30) } - property real defaultWidth: 220 - property real defaultHeight: 150 - property real animationFactor: 0.0 - property real animationDuration: 2000 - - SequentialAnimation on animationFactor { - loops: Animation.Infinite - PropertyAnimation { - from: 0.0 - to: 1.0 - duration: animationDuration - } - } - - border.width: 2 - border.color: "black" - radius: 5 - width: defaultWidth - height: defaultHeight - - Text { - id: textItem - wrapMode: "WordWrap" - horizontalAlignment: "AlignHCenter" - text: container.text - anchors.left: parent.left - anchors.right: parent.right - } - - Rectangle { - id: viewportContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 1 - anchors.topMargin: 2 - anchors.top: textItem.bottom - anchors.bottom: container.bottom - color: "#aaccee" - - Viewport { - id: view - anchors.fill: parent - picking: true - camera: container.camera - Teapot - { - id: model - x: itemX - y: itemY - z: itemZ - } - } - } -} diff --git a/tests/manual/translation/qml/TranslationVectorTestCase.qml b/tests/manual/translation/qml/TranslationVectorTestCase.qml deleted file mode 100644 index 79bbe8fd..00000000 --- a/tests/manual/translation/qml/TranslationVectorTestCase.qml +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -Rectangle { - id: container - // Parameters for editting - property string text; - property variant translationVectorA: Qt.vector3d(1,1,1) - property variant translationVectorB: Qt.vector3d(1,1,1) - property variant camera: defaultCamera - - // Default values: - property variant defaultCamera: Camera {eye: Qt.vector3d(0,5,30)} - property real defaultWidth: 220 - property real defaultHeight: 150 - property variant itemPosition: - Qt.vector3d((translationVectorB.x * animationFactor + - translationVectorA.x * (1.0 - animationFactor)), - translationVectorB.y * animationFactor + - translationVectorA.y * (1.0 - animationFactor), - translationVectorB.z * animationFactor + - translationVectorA.z * (1.0 - animationFactor)) - property real animationFactor: 0.0 - property int animationDuration: 2000 - - SequentialAnimation on animationFactor { - loops: Animation.Infinite - PropertyAnimation { - from: 0.0 - to: 1.0 - duration: animationDuration - } - } - - border.width: 2 - border.color: "black" - radius: 5 - width: defaultWidth - height: defaultHeight - - Text { - id: textItem - wrapMode: "WordWrap" - horizontalAlignment: "AlignHCenter" - text: container.text - anchors.left: parent.left - anchors.right: parent.right - } - - Rectangle { - id: viewportContainer - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 1 - anchors.topMargin: 2 - anchors.top: textItem.bottom - anchors.bottom: container.bottom - color: "#aaccee" - - Viewport { - id: view - anchors.fill: parent - picking: true - camera: container.camera - Teapot - { - id: model - position: itemPosition - } - } - } -} diff --git a/tests/manual/translation/qml/tst_translation.qml b/tests/manual/translation/qml/tst_translation.qml deleted file mode 100644 index 0cea31b7..00000000 --- a/tests/manual/translation/qml/tst_translation.qml +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt3D 1.0 -import Qt3D.Shapes 1.0 - -// QTBUG-17408 -Item { - id: screen - width: aTestCase.defaultWidth * 3 - height: aTestCase.defaultHeight * 4 - - Flow { - anchors.fill: parent - TranslationVectorTestCase { - id: aTestCase - text: "X Translation\n(Left to Right)" - translationVectorA: Qt.vector3d(-4,1,1) - translationVectorB: Qt.vector3d(4,1,1) - } - - TranslationVectorTestCase { - text: "Y Translation\n(Bottom to Top)" - translationVectorA: Qt.vector3d(1,-4,1) - translationVectorB: Qt.vector3d(1,4,1) - } - - TranslationVectorTestCase { - text: "Z Translation\n(Back to Front)" - translationVectorA: Qt.vector3d(1,1,-4) - translationVectorB: Qt.vector3d(1,1,4) - } - - TranslationVectorTestCase { - text: "-X Translation\n(Right to Left)" - translationVectorA: Qt.vector3d(4,1,1) - translationVectorB: Qt.vector3d(-4,1,1) - } - - TranslationVectorTestCase { - text: "-Y Translation\n(Top to Bottom)" - translationVectorA: Qt.vector3d(1,4,1) - translationVectorB: Qt.vector3d(1,-4,1) - } - - TranslationVectorTestCase { - text: "-Z Translation\n(Front to Back)" - translationVectorA: Qt.vector3d(1,1,4) - translationVectorB: Qt.vector3d(1,1,-4) - } - - TranslationVectorTestCase { - text: "Sequential Translation in X,Y,Z\n(Previous 6 in order)" - id: sequentialTestCase - property real itemX:-4; - property real itemY:-4; - property real itemZ:-4; - itemPosition: Qt.vector3d(itemX,itemY,itemZ) - // itemPosition: Qt.vector3d(itemX,4,4) - SequentialAnimation { - loops: Animation.Infinite - running: true - PropertyAnimation { - target: sequentialTestCase; property: "itemX"; - to: 4; duration: 1000 - } - PropertyAnimation { - target: sequentialTestCase; property: "itemY"; - to: 4; duration: 1000 - } - PropertyAnimation { - target: sequentialTestCase; property: "itemZ"; - to: 4; duration: 1000 - } - PropertyAnimation { - target: sequentialTestCase; property: "itemX"; - to: -4; duration: 1000 - } - PropertyAnimation { - target: sequentialTestCase; property: "itemY"; - to: -4; duration: 1000 - } - PropertyAnimation { - target: sequentialTestCase; property: "itemZ"; - to: -4; duration: 1000 - } - } - } - - TranslationTestCase { - text: "Translation in X,Y,Z properties\n(Smooth Animation)" - id: attributeTestCase - itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0); - itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0); - itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0); - animationDuration: 15000 - } - - TranslationVectorTestCase { - text: "Translation in Qt.Vector3d(X,Y,Z)\n(Smooth Animation)" - id: combinedVectorTestCase - property real itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0); - property real itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0); - property real itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0); - itemPosition: Qt.vector3d(itemX,itemY,itemZ) - animationDuration: 15000 - } - - AxesVsVectorTestCase { - text: "Last two overlaid\n(Should look like one teapot)" - id: axesVsVectorTestCase - itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0); - itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0); - itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0); - itemPosition: Qt.vector3d(itemX,itemY,itemZ) - animationDuration: 15000 - } - } -} diff --git a/tests/manual/translation/qtquick3d.png b/tests/manual/translation/qtquick3d.png Binary files differdeleted file mode 100644 index 8351083e..00000000 --- a/tests/manual/translation/qtquick3d.png +++ /dev/null diff --git a/tests/manual/translation/translation.pro b/tests/manual/translation/translation.pro deleted file mode 100644 index f88fb24a..00000000 --- a/tests/manual/translation/translation.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = app -TARGET = tst_translation -CONFIG += qt warn_on - -INSTALL_DIRS = qml -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() - -SOURCES += main.cpp diff --git a/tests/manual/translation/tst_translation_qml.desktop b/tests/manual/translation/tst_translation_qml.desktop deleted file mode 100644 index bbdab15c..00000000 --- a/tests/manual/translation/tst_translation_qml.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_translation -Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png -Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_translation -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_translation_qml |