summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro3
-rw-r--r--tests/auto/qml3d/QtQuickTest/TestCase.qml254
-rw-r--r--tests/auto/qml3d/QtQuickTest/qmldir1
-rw-r--r--tests/auto/qml3d/QtQuickTest/testlogger.js164
-rw-r--r--tests/auto/qml3d/effect/test.pngbin159 -> 0 bytes
-rw-r--r--tests/auto/qml3d/effect/tst_effect.qml118
-rw-r--r--tests/auto/qml3d/item3d/square.3dsbin120 -> 0 bytes
-rw-r--r--tests/auto/qml3d/item3d/test_data/test-image.pngbin4445 -> 0 bytes
-rw-r--r--tests/auto/qml3d/item3d/tst_item3d.qml398
-rw-r--r--tests/auto/qml3d/item3d/tst_item3d_local_v_world.qml213
-rw-r--r--tests/auto/qml3d/item3d/tst_missing_texture_coordinates.qml74
-rw-r--r--tests/auto/qml3d/lookat/tst_lookat.qml195
-rw-r--r--tests/auto/qml3d/mesh/test_data/teapot.bez340
-rw-r--r--tests/auto/qml3d/mesh/tst_mesh.qml127
-rw-r--r--tests/auto/qml3d/modelview/textures/amethyst.jpgbin3103 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/textures/bigblue.jpgbin1052 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/textures/blueweb.jpgbin4506 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/textures/pastelstuff.jpgbin4408 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/textures/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/textures/threedgreen.jpgbin3581 -> 0 bytes
-rw-r--r--tests/auto/qml3d/modelview/tst_modelview.qml274
-rw-r--r--tests/auto/qml3d/picking/tst_picking.qml184
-rw-r--r--tests/auto/qml3d/qml3d.pro27
-rw-r--r--tests/auto/qml3d/scale3d/tst_scale3d.qml113
-rw-r--r--tests/auto/qml3d/sphere/tst_sphere.qml129
-rw-r--r--tests/auto/qml3d/tst_qml3d.cpp44
-rw-r--r--tests/auto/qml3d/viewport/tst_viewport.qml140
-rw-r--r--tests/auto/threed/load_model/load_model.pro10
-rw-r--r--tests/auto/threed/load_model/load_model.qrc13
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.3dsbin435 -> 0 bytes
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.blendbin128232 -> 0 bytes
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.dae192
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.m3gbin1188 -> 0 bytes
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.mtl22
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.obj27
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.ply43
-rw-r--r--tests/auto/threed/load_model/models/basic-cube.x3d30
-rw-r--r--tests/auto/threed/load_model/models/cube.dae146
-rw-r--r--tests/auto/threed/load_model/models/teacup.bez280
-rw-r--r--tests/auto/threed/load_model/models/wave.obj476
-rw-r--r--tests/auto/threed/load_model/tst_load_model.cpp237
-rw-r--r--tests/auto/threed/qareaallocator/qareaallocator.pro7
-rw-r--r--tests/auto/threed/qareaallocator/tst_qareaallocator.cpp280
-rw-r--r--tests/auto/threed/qarray/qarray.pro7
-rw-r--r--tests/auto/threed/qarray/tst_qarray.cpp1862
-rw-r--r--tests/auto/threed/qbox3d/qbox3d.pro7
-rw-r--r--tests/auto/threed/qbox3d/tst_qbox3d.cpp1302
-rw-r--r--tests/auto/threed/qcolor4ub/qcolor4ub.pro7
-rw-r--r--tests/auto/threed/qcolor4ub/tst_qcolor4ub.cpp341
-rw-r--r--tests/auto/threed/qcustomdataarray/qcustomdataarray.pro7
-rw-r--r--tests/auto/threed/qcustomdataarray/tst_qcustomdataarray.cpp139
-rw-r--r--tests/auto/threed/qgeometrydata/qgeometrydata.pro13
-rw-r--r--tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp631
-rw-r--r--tests/auto/threed/qglabstractsurface/qglabstractsurface.pro10
-rw-r--r--tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp364
-rw-r--r--tests/auto/threed/qglattributedescription/qglattributedescription.pro10
-rw-r--r--tests/auto/threed/qglattributedescription/tst_qglattributedescription.cpp137
-rw-r--r--tests/auto/threed/qglattributeset/qglattributeset.pro7
-rw-r--r--tests/auto/threed/qglattributeset/tst_qglattributeset.cpp213
-rw-r--r--tests/auto/threed/qglattributevalue/qglattributevalue.pro10
-rw-r--r--tests/auto/threed/qglattributevalue/tst_qglattributevalue.cpp262
-rw-r--r--tests/auto/threed/qglbezierpatches/qglbezierpatches.pro7
-rw-r--r--tests/auto/threed/qglbezierpatches/tst_qglbezierpatches.cpp214
-rw-r--r--tests/auto/threed/qglbuilder/qglbuilder.pro9
-rw-r--r--tests/auto/threed/qglbuilder/tst_qglbuilder.cpp888
-rw-r--r--tests/auto/threed/qglcamera/qglcamera.pro11
-rw-r--r--tests/auto/threed/qglcamera/tst_qglcamera.cpp327
-rw-r--r--tests/auto/threed/qglcameraanimation/qglcameraanimation.pro10
-rw-r--r--tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp134
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/collada_cube.xml127
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro16
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/rose01.jpgbin1835 -> 0 bytes
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp312
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.qrc8
-rw-r--r--tests/auto/threed/qglcube/qglcube.pro8
-rw-r--r--tests/auto/threed/qglcube/tst_qglcube.cpp185
-rw-r--r--tests/auto/threed/qglcylinder/qglcylinder.pro8
-rw-r--r--tests/auto/threed/qglcylinder/tst_qglcylinder.cpp283
-rw-r--r--tests/auto/threed/qglindexbuffer/qglindexbuffer.pro7
-rw-r--r--tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp477
-rw-r--r--tests/auto/threed/qgllightmodel/qgllightmodel.pro7
-rw-r--r--tests/auto/threed/qgllightmodel/tst_qgllightmodel.cpp122
-rw-r--r--tests/auto/threed/qgllightparameters/qgllightparameters.pro7
-rw-r--r--tests/auto/threed/qgllightparameters/tst_qgllightparameters.cpp275
-rw-r--r--tests/auto/threed/qglmaterial/qglmaterial.pro10
-rw-r--r--tests/auto/threed/qglmaterial/tst_qglmaterial.cpp726
-rw-r--r--tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro7
-rw-r--r--tests/auto/threed/qglmaterialcollection/tst_qglmaterialcollection.cpp236
-rw-r--r--tests/auto/threed/qglpainter/qglpainter.pro19
-rw-r--r--tests/auto/threed/qglpainter/qglsimulator.cpp129
-rw-r--r--tests/auto/threed/qglpainter/qglsimulator.h91
-rw-r--r--tests/auto/threed/qglpainter/qgltestwidget.cpp127
-rw-r--r--tests/auto/threed/qglpainter/qgltestwidget.h75
-rw-r--r--tests/auto/threed/qglpainter/tst_qglpainter.cpp917
-rw-r--r--tests/auto/threed/qglpickcolors/qglpickcolors.pro15
-rw-r--r--tests/auto/threed/qglpickcolors/tst_qglpickcolors.cpp299
-rw-r--r--tests/auto/threed/qglrender/qglrender.pro10
-rw-r--r--tests/auto/threed/qglrender/tst_qglrender.cpp262
-rw-r--r--tests/auto/threed/qglscenenode/qglscenenode.pro11
-rw-r--r--tests/auto/threed/qglscenenode/tst_qglscenenode.cpp780
-rw-r--r--tests/auto/threed/qglsection/qglsection.pro9
-rw-r--r--tests/auto/threed/qglsection/tst_qglsection.cpp674
-rw-r--r--tests/auto/threed/qglsharedresource/qglsharedresource.pro12
-rw-r--r--tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp159
-rw-r--r--tests/auto/threed/qglsphere/qglsphere.pro8
-rw-r--r--tests/auto/threed/qglsphere/tst_qglsphere.cpp125
-rw-r--r--tests/auto/threed/qglvertexbundle/qglvertexbundle.pro8
-rw-r--r--tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp282
-rw-r--r--tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro7
-rw-r--r--tests/auto/threed/qgraphicstransform3d/tst_qgraphicstransform3d.cpp280
-rw-r--r--tests/auto/threed/qplane3d/qplane3d.pro7
-rw-r--r--tests/auto/threed/qplane3d/tst_qplane3d.cpp450
-rw-r--r--tests/auto/threed/qray3d/qray3d.pro6
-rw-r--r--tests/auto/threed/qray3d/tst_qray3d.cpp540
-rw-r--r--tests/auto/threed/qsphere3d/qsphere3d.pro7
-rw-r--r--tests/auto/threed/qsphere3d/tst_qsphere3d.cpp238
-rw-r--r--tests/auto/threed/qstereoimage/qstereoimage.pro11
-rw-r--r--tests/auto/threed/qstereoimage/tst_qstereoimage.cpp428
-rw-r--r--tests/auto/threed/qtriangle3d/qtriangle3d.pro7
-rw-r--r--tests/auto/threed/qtriangle3d/tst_qtriangle3d.cpp714
-rw-r--r--tests/auto/threed/qvectorarray/qvectorarray.pro10
-rw-r--r--tests/auto/threed/qvectorarray/tst_qvectorarray.cpp664
-rw-r--r--tests/auto/threed/threed.pro39
-rw-r--r--tests/benchmarks/benchmarks.pro4
-rw-r--r--tests/benchmarks/matrix_properties/data/CustomObject.qml46
-rw-r--r--tests/benchmarks/matrix_properties/data/matrix_component.qml171
-rw-r--r--tests/benchmarks/matrix_properties/matrix_properties.pro12
-rw-r--r--tests/benchmarks/matrix_properties/tst_matrix_properties.cpp177
-rw-r--r--tests/benchmarks/qarray/qarray.pro5
-rw-r--r--tests/benchmarks/qarray/tst_qarray.cpp503
-rw-r--r--tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro6
-rw-r--r--tests/benchmarks/qglbuilder_perf/tst_qglbuilder_perf.cpp245
-rw-r--r--tests/manual/animations/animations.pro13
-rw-r--r--tests/manual/animations/animations.qmlproject16
-rw-r--r--tests/manual/animations/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/animations/info.json16
-rw-r--r--tests/manual/animations/m5-tst_animations_qml.desktop14
-rw-r--r--tests/manual/animations/main.cpp44
-rw-r--r--tests/manual/animations/mt.qml52
-rw-r--r--tests/manual/animations/qml/TestCase.qml89
-rw-r--r--tests/manual/animations/qml/desktop.qml52
-rw-r--r--tests/manual/animations/qml/tst_animations.qml117
-rw-r--r--tests/manual/animations/tst_animations_qml.desktop8
-rw-r--r--tests/manual/background/background.pro12
-rw-r--r--tests/manual/background/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/background/main.cpp44
-rw-r--r--tests/manual/background/qml/sky.pngbin331943 -> 0 bytes
-rw-r--r--tests/manual/background/qml/tst_background.qml72
-rw-r--r--tests/manual/basic/README11
-rw-r--r--tests/manual/basic/basic.pro12
-rw-r--r--tests/manual/basic/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/basic/main.cpp44
-rw-r--r--tests/manual/basic/qml/tst_basic.qml141
-rw-r--r--tests/manual/displaymodel/README16
-rw-r--r--tests/manual/displaymodel/displaymodel.pro13
-rw-r--r--tests/manual/displaymodel/displaymodel.qmlproject16
-rw-r--r--tests/manual/displaymodel/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/displaymodel/info.json16
-rw-r--r--tests/manual/displaymodel/main.cpp44
-rw-r--r--tests/manual/displaymodel/mt.qml52
-rw-r--r--tests/manual/displaymodel/qml/desktop.qml52
-rw-r--r--tests/manual/displaymodel/qml/meshes/lunar-lander.3dsbin23456 -> 0 bytes
-rw-r--r--tests/manual/displaymodel/qml/meshes/monkey.mtl2
-rw-r--r--tests/manual/displaymodel/qml/meshes/monkey.obj1013
-rw-r--r--tests/manual/displaymodel/qml/meshes/teapot.bez340
-rw-r--r--tests/manual/displaymodel/qml/tst_displaymodel.qml371
-rw-r--r--tests/manual/fullreferencing/README11
-rw-r--r--tests/manual/fullreferencing/fullreferencing.pro12
-rw-r--r--tests/manual/fullreferencing/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/fullreferencing/main.cpp44
-rw-r--r--tests/manual/fullreferencing/qml/meshes/hazard.pngbin64685 -> 0 bytes
-rw-r--r--tests/manual/fullreferencing/qml/meshes/robot.3dsbin76250 -> 0 bytes
-rw-r--r--tests/manual/fullreferencing/qml/tst_fullreferencing.qml75
-rw-r--r--tests/manual/icon.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/manual.pro15
-rw-r--r--tests/manual/model3ds/README12
-rw-r--r--tests/manual/model3ds/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/model3ds/info.json16
-rw-r--r--tests/manual/model3ds/m5-tst_submesh_qml.desktop14
-rw-r--r--tests/manual/model3ds/main.cpp44
-rw-r--r--tests/manual/model3ds/model3ds.pro13
-rw-r--r--tests/manual/model3ds/model3ds.qmlproject16
-rw-r--r--tests/manual/model3ds/model3ds.qrc10
-rw-r--r--tests/manual/model3ds/mt.qml52
-rw-r--r--tests/manual/model3ds/qml/desktop.qml52
-rw-r--r--tests/manual/model3ds/qml/meshes/hazard.pngbin64685 -> 0 bytes
-rw-r--r--tests/manual/model3ds/qml/meshes/lunar-lander.3dsbin23456 -> 0 bytes
-rw-r--r--tests/manual/model3ds/qml/meshes/monkey.3dsbin13886 -> 0 bytes
-rw-r--r--tests/manual/model3ds/qml/meshes/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--tests/manual/model3ds/qml/meshes/robot.3dsbin76250 -> 0 bytes
-rw-r--r--tests/manual/model3ds/qml/tst_model3ds.qml199
-rw-r--r--tests/manual/model3ds/tst_submesh_qml.desktop8
-rw-r--r--tests/manual/navigation1/README8
-rw-r--r--tests/manual/navigation1/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/navigation1/info.json16
-rw-r--r--tests/manual/navigation1/main.cpp44
-rw-r--r--tests/manual/navigation1/mt.qml52
-rw-r--r--tests/manual/navigation1/navigation1.pro13
-rw-r--r--tests/manual/navigation1/navigation1.qmlproject16
-rw-r--r--tests/manual/navigation1/qml/desktop.qml52
-rw-r--r--tests/manual/navigation1/qml/meshes/monkey.3dsbin13886 -> 0 bytes
-rw-r--r--tests/manual/navigation1/qml/tst_navigation1.qml133
-rw-r--r--tests/manual/qrc/README4
-rw-r--r--tests/manual/qrc/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/qrc/m5-tst_qrc_qml.desktop14
-rw-r--r--tests/manual/qrc/main.cpp68
-rw-r--r--tests/manual/qrc/qml/cube.qml63
-rw-r--r--tests/manual/qrc/qml/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--tests/manual/qrc/qrc.pro20
-rw-r--r--tests/manual/qrc/qrc.qrc6
-rw-r--r--tests/manual/qrc/tst_qrc_qml.desktop8
-rw-r--r--tests/manual/rotation/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/rotation/info.json16
-rw-r--r--tests/manual/rotation/m5-tst_rotation_qml.desktop14
-rw-r--r--tests/manual/rotation/main.cpp44
-rw-r--r--tests/manual/rotation/mt.qml52
-rw-r--r--tests/manual/rotation/qml/TestCase.qml97
-rw-r--r--tests/manual/rotation/qml/desktop.qml52
-rw-r--r--tests/manual/rotation/qml/tst_rotation.qml102
-rw-r--r--tests/manual/rotation/rotation.pro13
-rw-r--r--tests/manual/rotation/rotation.qmlproject16
-rw-r--r--tests/manual/rotation/tst_rotation_qml.desktop8
-rw-r--r--tests/manual/scaling/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/scaling/info.json16
-rw-r--r--tests/manual/scaling/m5-tst_scaling_qml.desktop14
-rw-r--r--tests/manual/scaling/main.cpp44
-rw-r--r--tests/manual/scaling/mt.qml52
-rw-r--r--tests/manual/scaling/qml/ScalingTestCase.qml122
-rw-r--r--tests/manual/scaling/qml/desktop.qml52
-rw-r--r--tests/manual/scaling/qml/tst_scaling.qml150
-rw-r--r--tests/manual/scaling/scaling.pro13
-rw-r--r--tests/manual/scaling/scaling.qmlproject16
-rw-r--r--tests/manual/scaling/tst_scaling_qml.desktop8
-rw-r--r--tests/manual/shapes/README6
-rw-r--r--tests/manual/shapes/main.cpp44
-rw-r--r--tests/manual/shapes/qml/tst_shapes.qml98
-rw-r--r--tests/manual/shapes/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/shapes/shapes.pro13
-rw-r--r--tests/manual/shapes/tst_shapes_qml.desktop7
-rw-r--r--tests/manual/submesh/README9
-rw-r--r--tests/manual/submesh/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/submesh/info.json16
-rw-r--r--tests/manual/submesh/m5-tst_submesh_qml.desktop14
-rw-r--r--tests/manual/submesh/main.cpp44
-rw-r--r--tests/manual/submesh/mt.qml52
-rw-r--r--tests/manual/submesh/qml/desktop.qml52
-rw-r--r--tests/manual/submesh/qml/meshes/lunar-lander.3dsbin23456 -> 0 bytes
-rw-r--r--tests/manual/submesh/qml/tst_submesh.qml207
-rw-r--r--tests/manual/submesh/submesh.pro13
-rw-r--r--tests/manual/submesh/submesh.qmlproject16
-rw-r--r--tests/manual/submesh/tst_submesh_qml.desktop8
-rw-r--r--tests/manual/transformations/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/transformations/info.json16
-rw-r--r--tests/manual/transformations/m5-tst_transformations_qml.desktop14
-rw-r--r--tests/manual/transformations/main.cpp44
-rw-r--r--tests/manual/transformations/mt.qml52
-rw-r--r--tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml149
-rw-r--r--tests/manual/transformations/qml/TransformationListTestCase.qml144
-rw-r--r--tests/manual/transformations/qml/desktop.qml52
-rw-r--r--tests/manual/transformations/qml/tst_transformations.qml64
-rw-r--r--tests/manual/transformations/transformations.pro13
-rw-r--r--tests/manual/transformations/transformations.qmlproject16
-rw-r--r--tests/manual/transformations/tst_transformations_qml.desktop8
-rw-r--r--tests/manual/translation/README1
-rw-r--r--tests/manual/translation/icon-l-qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/translation/info.json16
-rw-r--r--tests/manual/translation/m5-tst_translation_qml.desktop14
-rw-r--r--tests/manual/translation/main.cpp44
-rw-r--r--tests/manual/translation/mt.qml52
-rw-r--r--tests/manual/translation/qml/AxesVsVectorTestCase.qml155
-rw-r--r--tests/manual/translation/qml/TranslationTestCase.qml110
-rw-r--r--tests/manual/translation/qml/TranslationVectorTestCase.qml114
-rw-r--r--tests/manual/translation/qml/desktop.qml52
-rw-r--r--tests/manual/translation/qml/tst_translation.qml158
-rw-r--r--tests/manual/translation/translation.pro13
-rw-r--r--tests/manual/translation/translation.qmlproject16
-rw-r--r--tests/manual/translation/tst_translation_qml.desktop8
-rw-r--r--tests/shared/compareimage.cpp165
-rw-r--r--tests/shared/compareimage.h54
-rw-r--r--tests/shared/qmlres.h150
-rw-r--r--tests/shared/qtest_helpers.h159
-rw-r--r--tests/tests.pro4
282 files changed, 0 insertions, 30059 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
deleted file mode 100644
index a1653fbc..00000000
--- a/tests/auto/auto.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = threed
-# SUBDIRS += qml3d
diff --git a/tests/auto/qml3d/QtQuickTest/TestCase.qml b/tests/auto/qml3d/QtQuickTest/TestCase.qml
deleted file mode 100644
index 1d44d4f6..00000000
--- a/tests/auto/qml3d/QtQuickTest/TestCase.qml
+++ /dev/null
@@ -1,254 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import "testlogger.js" as TestLogger
-
-Item {
- id: testCase
- visible: false
-
- // Name of the test case to prefix the function name in messages.
- property string name
-
- // Set to true to start the test running.
- property bool when: true
-
- // Set to true once the test has completed.
- property bool completed: false
-
- // Set to true when the test is running but not yet complete.
- property bool running: false
-
- // Set to true if the test doesn't have to run (because some
- // other test failed which this one depends on).
- property bool optional: false
-
- // Internal private state
- property string currentTestCase
- property bool expectingFail
- property string expectFailMsg
- property bool prevWhen: true
- property int testId: -1
-
- TestReport { id: reporter }
-
- function fail(msg) {
- if (!msg)
- msg = "";
- if (expectingFail) {
- TestLogger.log_expect_fail(currentTestCase, expectFailMsg, msg)
- throw new Error("QtTest::expect_fail")
- } else {
- TestLogger.log_fail(currentTestCase, msg)
- throw new Error("QtTest::fail")
- }
- }
-
- function fail2(msg, msg2) {
- if (msg)
- fail(msg + ": " + msg2)
- else
- fail(msg2)
- }
-
- function verify(cond, msg) {
- if (!cond)
- fail(msg)
- }
-
- function compare(actual, expected, msg) {
- if (typeof actual == "number" && typeof expected == "number") {
- // Use a fuzzy compare if the two values are floats
- if (Math.abs(actual - expected) <= 0.00001)
- return
- } else if (typeof actual == "object" && typeof expected == "object") {
- // Does the expected value look like a vector3d?
- if ("x" in expected && "y" in expected && "z" in expected) {
- if (Math.abs(actual.x - expected.x) <= 0.00001 &&
- Math.abs(actual.y - expected.y) <= 0.00001 &&
- Math.abs(actual.z - expected.z) <= 0.00001)
- return
- fail2(msg, "actual: Qt.vector3d(" +
- actual.x + ", " + actual.y + ", " + actual.z +
- "), expected: Qt.vector3d(" +
- expected.x + ", " + expected.y + ", " + expected.z +
- ")")
- return
- }
- if (actual == expected)
- return
- } else if (actual == expected) {
- return
- }
- fail2(msg, "actual: " + actual + ", expected: " + expected)
- }
-
- function skip(msg) {
- TestLogger.log_skip(currentTestCase, msg)
- throw new Error("QtTest::skip")
- }
-
- function expectFail(msg) {
- expectingFail = true
- expectFailMsg = msg
- }
-
- property variant testCaseResult
-
- function runInternal(prop, dataDriven, arg, tag) {
- currentTestCase = TestLogger.log_prefixed_name(name, prop)
- if (dataDriven && tag)
- currentTestCase += " [" + tag + "]"
- expectingFail = false
- var success = true
- try {
- testCaseResult = testCase[prop](arg)
- if (expectingFail) {
- success = false
- TestLogger.log_expect_fail_pass(currentTestCase)
- } else if (!dataDriven) {
- TestLogger.log_pass(currentTestCase)
- }
- } catch (e) {
- testCaseResult = []
- if (e.message == "QtTest::fail") {
- success = false
- } else if (e.message.indexOf("QtTest::") != 0) {
- // Test threw an unrecognized exception - fail.
- TestLogger.log_fail(currentTestCase, e.message)
- success = false
- }
- }
- return success
- }
-
- function run() {
- TestLogger.log_start_test(reporter)
- var success = true
- running = true
- var testList = []
- for (var prop in testCase) {
- if (prop.indexOf("test_") != 0)
- continue
- if (filterTestCases.length > 0) {
- // if there is a list, only run the tests in the list
- var excludeTest = true
- for (var i = 0; i < filterTestCases.length && excludeTest; i++)
- {
- if (filterTestCases[i] == prop)
- excludeTest = false
- }
- if (excludeTest)
- continue
- }
- var tail = prop.lastIndexOf("_data");
- if (tail != -1 && tail == (prop.length - 5))
- continue
- testList.push(prop)
- }
- testList.sort()
- for (var index in testList) {
- var prop = testList[index]
- var datafunc = prop + "_data"
- if (datafunc in testCase) {
- if (runInternal(datafunc, true)) {
- var table = testCaseResult
- var successThis = true
- var haveData = false
- for (var index in table) {
- haveData = true
- var row = table[index]
- if (!runInternal(prop, true, row, row.tag))
- successThis = false
- }
- if (!haveData)
- TestLogger.log_message("WARNING: no data supplied for " + prop + "() by " + datafunc + "()")
- if (successThis) {
- var prefix;
- if (name)
- prefix = name + "::"
- currentTestCase = prefix + prop + "()"
- TestLogger.log_pass(currentTestCase)
- } else {
- success = false
- }
- } else {
- success = false
- }
- } else {
- if (!runInternal(prop, false))
- success = false
- }
- }
- currentTestCase = ""
- running = false
- completed = true
- TestLogger.log_complete_test(testId, reporter)
- return success
- }
-
- onWhenChanged: {
- if (when != prevWhen) {
- prevWhen = when
- if (when && !completed && !running)
- run()
- }
- }
-
- onOptionalChanged: {
- if (!completed) {
- if (optional)
- TestLogger.log_optional_test(testId)
- else
- TestLogger.log_mandatory_test(testId)
- }
- }
-
- Component.onCompleted: {
- testId = TestLogger.log_register_test(name)
- if (optional)
- TestLogger.log_optional_test(testId)
- prevWhen = when
- if (when && !completed && !running)
- run()
- }
-}
diff --git a/tests/auto/qml3d/QtQuickTest/qmldir b/tests/auto/qml3d/QtQuickTest/qmldir
deleted file mode 100644
index 56f9177a..00000000
--- a/tests/auto/qml3d/QtQuickTest/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-TestCase 1.0 TestCase.qml
diff --git a/tests/auto/qml3d/QtQuickTest/testlogger.js b/tests/auto/qml3d/QtQuickTest/testlogger.js
deleted file mode 100644
index 54d537cc..00000000
--- a/tests/auto/qml3d/QtQuickTest/testlogger.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-.pragma library
-
-// We need a global place to store the results that can be
-// shared between multiple TestCase instances. Because QML
-// creates a separate scope for every inclusion of this file,
-// we hijack the global "Qt" object to store our data.
-function log_init_results()
-{
- if (!Qt.testResults) {
- Qt.testResults = {
- suiteName: "",
- reportedStart: false,
- numPassed: 0,
- numFailed: 0,
- numSkipped: 0,
- nextId: 0,
- testCases: [],
- reporter: null
- }
- }
-}
-
-function log_fail(testcase, msg)
-{
- if (!msg)
- msg = ""
- Qt.testResults.reporter.log_fail(testcase, msg);
- ++Qt.testResults.numFailed
-}
-
-function log_expect_fail(testcase, expectmsg, msg)
-{
- if (!msg)
- msg = ""
- if (expectmsg)
- Qt.testResults.reporter.log_expect_fail(testcase, expectmsg + " " + msg);
- else
- Qt.testResults.reporter.log_expect_fail(testcase, msg);
- ++Qt.testResults.numPassed
-}
-
-function log_expect_fail_pass(testcase)
-{
- Qt.testResults.reporter.log_expect_fail_pass(testcase);
- ++Qt.testResults.numFailed
-}
-
-function log_skip(testcase, msg)
-{
- if (!msg)
- msg = ""
- Qt.testResults.reporter.log_skip(testcase, msg);
- ++Qt.testResults.numSkipped
-}
-
-function log_pass(testcase)
-{
- Qt.testResults.reporter.log_pass(testcase);
- ++Qt.testResults.numPassed
-}
-
-function log_message(msg)
-{
- Qt.testResults.reporter.log_message(msg);
-}
-
-function log_register_test(name)
-{
- log_init_results()
- if (name && !Qt.testResults.suiteName)
- Qt.testResults.suiteName = name
- var testId = Qt.testResults.nextId++
- Qt.testResults.testCases.push(testId)
- return testId
-}
-
-function log_optional_test(testId)
-{
- log_init_results()
- var index = Qt.testResults.testCases.indexOf(testId)
- if (index >= 0)
- Qt.testResults.testCases.splice(index, 1)
-}
-
-function log_mandatory_test(testId)
-{
- log_init_results()
- var index = Qt.testResults.testCases.indexOf(testId)
- if (index == -1)
- Qt.testResults.testCases.push(testId)
-}
-
-function log_start_test(reporter)
-{
- log_init_results()
- Qt.testResults.reporter = reporter
- if (Qt.testResults.reportedStart)
- return
- Qt.testResults.reportedStart = true
-}
-
-function log_complete_test(testId, reporter)
-{
- var index = Qt.testResults.testCases.indexOf(testId)
- if (index >= 0)
- Qt.testResults.testCases.splice(index, 1)
- if (!Qt.testResults.testCases.length) {
- reporter.report(Qt.testResults.numPassed,
- Qt.testResults.numFailed,
- Qt.testResults.numSkipped)
- Qt.quit()
- }
-}
-
-function log_prefixed_name(name, funcname)
-{
- if (!name)
- name = Qt.testResults.suiteName
- if (name)
- return name + "::" + funcname + "()"
- else
- return funcname + "()"
-}
diff --git a/tests/auto/qml3d/effect/test.png b/tests/auto/qml3d/effect/test.png
deleted file mode 100644
index 80a4868f..00000000
--- a/tests/auto/qml3d/effect/test.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/effect/tst_effect.qml b/tests/auto/qml3d/effect/tst_effect.qml
deleted file mode 100644
index 6ac10617..00000000
--- a/tests/auto/qml3d/effect/tst_effect.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Item3D {
- Effect {
- id: "effect"
- }
- }
-
- Material {
- id: "china"
- ambientColor: "#c09680"
- specularColor: "#3c3c3c"
- shininess: 128
- }
-
- TestCase {
- name: "Effect"
-
- // Note that test_material must be called before tests that create
- // a material e.g. setColor() (tests are run in alphabetical order)
- function test_material() {
- verify(!effect.material, "default material is null")
- effect.material = china;
- compare(effect.material, china, "setMaterial()");
- }
-
- function test_setColor() {
- verify(effect.color == "#ffffff", "Default color is white");
- effect.color = "#ff4488";
- verify(effect.color == "#ff4488", "setColor()")
- }
-
- function test_lighting() {
- verify(effect.useLighting == true, "Default useLighting value is true");
- effect.useLighting = false;
- verify(effect.useLighting == false, "setUseLighting()")
- }
-
- function test_decal() {
- verify(effect.decal == false, "Default decal");
- effect.decal = true;
- verify(effect.decal == true, "setDecal()");
- }
-
- function test_blending() {
- verify(effect.blending == false, "Default blending");
- effect.blending = true;
- verify(effect.blending == true, "setBlending()");
- }
-
- function test_texture() {
- verify(effect.texture == "", "Default texture");
- effect.texture = "test.png";
- verify(effect.texture != "");
- var textureString = ("" + effect.texture);
- var protocolString = textureString.substring(0,5);
- var stringLength = textureString.length;
- var fileNameFragment = textureString.substring(stringLength-8,stringLength);
- compare(protocolString, "file:", "recognize local file");
- compare(fileNameFragment, "test.png", "correct file name");
- }
-
- function test_textureImage() {
- // No support for interrogating QImages from QML
- // so can't write meaningful test case for textureImage
- }
-
- function test_progress() {
- verify(effect.progress == 0.0);
- }
- }
-}
diff --git a/tests/auto/qml3d/item3d/square.3ds b/tests/auto/qml3d/item3d/square.3ds
deleted file mode 100644
index 60c3be93..00000000
--- a/tests/auto/qml3d/item3d/square.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/item3d/test_data/test-image.png b/tests/auto/qml3d/item3d/test_data/test-image.png
deleted file mode 100644
index 9a25b489..00000000
--- a/tests/auto/qml3d/item3d/test_data/test-image.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/item3d/tst_item3d.qml b/tests/auto/qml3d/item3d/tst_item3d.qml
deleted file mode 100644
index 1a34b035..00000000
--- a/tests/auto/qml3d/item3d/tst_item3d.qml
+++ /dev/null
@@ -1,398 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Item3D {
- id: "other"
- scale: 12
- position: Qt.vector3d(1.0, 3.0, 5.0);
- mesh: Mesh {
-
- }
- pretransform: [
- Rotation3D { id: other_item_pretransform1 ; angle: 30 ; axis: Qt.vector3d(0, 1, 0)},
- Rotation3D { id: other_item_pretransform2; angle: 90 ; axis: Qt.vector3d(1, 0, 0)}
- ]
-
- transform: [
- Rotation3D { id: other_teapot_rotate1 ; angle: 0 ; axis: Qt.vector3d(0, 1, 0)},
- Rotation3D { id: other_teapot_rotate2; angle: 0 ; axis: Qt.vector3d(0, 0, 1)}
- ]
- }
-
- Effect {
- id: "testEffect"
- }
-
- Light {
- id: "testLight"
- }
-
- Item3D {
- id: item
- property int positionHasBeenChanged: 0
- onPositionChanged : positionHasBeenChanged = positionHasBeenChanged + 1;
-
- property bool onScaleChangedSignalTriggered: false
- onScaleChanged: onScaleChangedSignalTriggered = true
-
- property bool onMeshChangedSignalTriggered: false
- onMeshChanged: onMeshChangedSignalTriggered = true
-
- property bool onEnabledChangedSignalTriggered:false
- onEnabledChanged: onEnabledChangedSignalTriggered = true
-
- property bool onEffectChangedSignalTriggered: false
- onEffectChanged: onEffectChangedSignalTriggered = true
-
- property int childrenHasBeenChanged: 0
- onChildrenChanged: childrenHasBeenChanged = childrenHasBeenChanged + 1
-
- property bool onLightChangedSignalTriggered: false
- onLightChanged: onLightChangedSignalTriggered = true
-
- property int stateChangeTestVariable: 0
-
- property bool onStateChangedSignalTriggered: false
- onStateChanged: onStateChangedSignalTriggered = true
-
- property bool onSortChildrenSignalTriggered: false
- onSortChildrenChanged: onSortChildrenSignalTriggered = true
-
- property bool onClickedSignalTriggered: false
- onClicked: onClickedSignalTriggered = true
-
- Item3D {
- id: child1
- }
-
- Item3D {
- id: child2
- }
-
- Item3D {
- id: inheritEventTestChild
- }
-
- states: [
- State {
- name: "testState1"
- PropertyChanges { target: item; stateChangeTestVariable: 1}
- },
- State {
- name: "testState2"
- PropertyChanges { target: item; stateChangeTestVariable: 2}
- }
- ]
-
- TestCase {
- name: "Item3D"
-
- // Helper function that finds the index of an object in a list
- function indexOf(list, object)
- {
- for (var i = 0; i < list.length; i++)
- if (list[i] == object)
- return i;
- return -1;
- }
-
- function test_position()
- {
- // Warning: ordering sensitivity.
- // The test_x_property, test_y_property and test_z_property
- // tests alter position, which will cause this test to fail
- // if it is run afterwards.
-
- compare(item.position.x, 0, "Default position x");
- compare(item.position.y, 0, "Default position y");
- compare(item.position.z, 0, "Default position z");
-
- verify(item.x == 0, "Default x");
- verify(item.y == 0, "Default y");
- verify(item.z == 0, "Default z");
-
- verify(!item.positionHasBeenChanged, "pre signal test");
- item.position = Qt.vector3d(1,-6,1234567);
- compare(item.positionHasBeenChanged, 1, "onPositionChanged signal");
- verify(item.position.x == 1, "Set position x");
- verify(item.position.y == -6, "Set position y negative");
- verify(item.position.z == 1234567, "seven significant digits");
-
- verify(item.x == 1, "position changes x");
- verify(item.y == -6, "position changes y");
- verify(item.z == 1234567, "position changex z");
-
- item.position.x = -1;
- compare(item.positionHasBeenChanged, 2, "onPositionChanged signal from position.x property");
- item.position.y = 12;
- compare(item.positionHasBeenChanged, 3, "onPositionChanged signal from position.y property");
- item.position.z = 83461;
- compare(item.positionHasBeenChanged, 4, "onPositionChanged signal from position.z property");
- verify(item.x == -1, "position.x changes x");
- verify(item.y == 12, "position.y changes y");
- verify(item.z == 83461, "position.z changes z");
- }
-
-// test_x crashes even with a skip. Possibly associated with the short name?
- function test_x_property()
- {
- item.positionHasBeenChanged = 0;
- verify(!item.positionHasBeenChanged, "pre signal test");
-
- item.x = 324;
- verify(item.x == 324, "Set x");
- verify(item.position.x == 324, "position modified by setting x");
- compare(item.positionHasBeenChanged, 1, "onPositionChanged signal after setting x");
-
- item.x = -7;
- verify(item.x == -7, "Set x negative");
- verify(item.position.x == -7, "position modified by setting x negative");
- compare(item.positionHasBeenChanged, 2, "onPositionChanged signal after setting x negative");
-
- item.position = Qt.vector3d(2,-7,2345671);
- verify(item.x == 2, "x changed by setting postion");
- }
-
- function test_y_property()
- {
- item.positionHasBeenChanged = 0;
- verify(!item.positionHasBeenChanged, "pre signal test");
-
- item.y = 346;
- verify(item.y == 346, "Set y");
- verify(item.position.y == 346, "position modified by setting y");
- compare(item.positionHasBeenChanged, 1, "onPositionChanged signal after setting y");
-
- item.y = -12;
- verify(item.y == -12, "Set y negative");
- verify(item.position.y == -12, "position modified by setting y negative");
- compare(item.positionHasBeenChanged, 2, "onPositionChanged signal after setting y negative");
-
- item.position = Qt.vector3d(2, 13,2345671);
- verify(item.y == 13, "y changed by setting postion");
- }
-
- function test_z_property()
- {
- item.positionHasBeenChanged = 0;
- verify(!item.positionHasBeenChanged, "pre signal test");
-
- item.z = 19375;
- verify(item.z == 19375, "Set z");
- verify(item.position.z == 19375, "position modified by setting z");
- compare(item.positionHasBeenChanged, 1, "onPositionChanged signal after setting z");
-
- item.z = -74635;
- verify(item.z == -74635, "Set z negative");
- verify(item.position.z == -74635, "position modified by setting z negative");
- compare(item.positionHasBeenChanged, 2, "onPositionChanged signal after setting z negative");
-
- skip("comparing reals is too precise");
- item.z = 0.435;
- compare(item.z, 0.435, "setting z to a real number")
- compare(item.position.z, 0.435, "position modified by setting z to a real");
- compare(item.positionHasBeenChanged, 3, "onPositionChanged signal after setting z to a real");
-
- item.position = Qt.vector3d(2, 67,2345671);
- verify(item.z == 2345671, "z changed by setting postion");
- }
-
- function test_scale()
- {
- verify(!item.onScaleChangedSignalTriggered);
- compare(item.scale, 1, "default value");
- item.scale = 2.5;
- compare(item.scale, 2.5, "setScale");
- verify(item.onScaleChangedSignalTriggered, "scaleChanged signal");
- item.scale = other.scale;
- compare(item.scale, 12, "setScale from other item");
- }
-
- function test_transform()
- {
- compare(item.transform.length, 0, "Default transformations are empty");
- compare(other.transform.length, 2, "non-empty transform");
- // no public set function
- }
-
- function test_pretransform()
- {
- compare(item.pretransform.length, 0, "Default pretransformations are empty");
- compare(other.pretransform.length, 2, "non-empty pretransform");
- // no public set function
- }
-
- function test_inheritEvents()
- {
- verify(!item.inheritEvents, "default inheritEvents is false");
- compare(item.onClickedSignalTriggered, false, "pretest onClickedSignalTriggered check");
- compare(inheritEventTestChild.parent, item, "pretest parent check");
-
- inheritEventTestChild.clicked();
- compare(item.onClickedSignalTriggered, false,
- "no parent event when inheritEvents is false");
-
- item.inheritEvents = true;
- verify(item.inheritEvents, "setInheritEvents()");
- inheritEventTestChild.clicked();
- compare(item.onClickedSignalTriggered, true, "parent event when inheritEvents is true");
- }
-
- function test_mesh()
- {
- verify(!item.mesh, "default mesh value");
- verify(other.mesh != null, "non-null mesh");
- item.mesh = other.mesh;
- verify(item.onMeshChangedSignalTriggered, "MeshChanged signal");
- verify(item.mesh == other.mesh, "setMesh()");
- }
-
- function test_effect()
- {
- verify(!item.effect, "default effect is null");
- item.effect = testEffect;
- verify(item.onEffectChangedSignalTriggered, "onEffectChanged signal");
- verify(item.effect == testEffect, "setEffect()");
- }
-
- function test_light()
- {
- verify(!item.light, "default lightparamters is null");
- item.light = testLight;
- verify(item.onLightChangedSignalTriggered, "onLightChangedSignal");
- verify(item.light == testLight, "setLight()");
- }
-
- function test_resources()
- {
- verify(item.resources != undefined, "item has resources");
- verify(other.resources != undefined, "other item has resources");
- // No public write method
- }
-
- function test_data()
- {
- verify(item.data != undefined, "item has data");
- verify(other.data != undefined, "other item has data");
- // No public write method
- }
-
- function test_children()
- {
- verify(item.children.length >= 0, "item.children can be called");
- verify(indexOf(item.children, child1) != -1, "item.children contains child1")
- verify(indexOf(item.children, child2) != -1, "item.children contains child2")
- verify(indexOf(item.children, inheritEventTestChild) != -1, "item.children contains inheritEventTestChild")
- }
-
- function test_state()
- {
- verify(!item.state, "Default state is null");
- verify(item.stateChangeTestVariable == 0, "property check before state change");
- item.state = "testState1";
- verify(item.onStateChangedSignalTriggered, "onStateChanged signal");
- verify(item.state == "testState1", "setState()");
- verify(item.stateChangeTestVariable == 1, "property changed with new state");
- }
-
- function test_enabled()
- {
- verify(item.enabled, "default value")
- item.enabled = false;
- verify(!item.enabled, "setEnabled false")
- verify(item.onEnabledChangedSignalTriggered, "enabledChanged signal")
- }
-
- function test_parent()
- {
- compare(item.childrenHasBeenChanged,0, "pretest marker verification");
-
- // Test the initial Item3D parent/child relationships.
- verify(item.parent == viewport, "root item")
- verify(child1.parent == item, "child1 item")
- verify(child2.parent == item, "child2 item")
- compare(child1.children.length, 0, "child1 children")
- verify(indexOf(item.children, child1) != -1, "children contains child1")
- verify(indexOf(item.children, child2) != -1, "children contains child2")
-
- // Reparent the second child and re-test.
- child2.parent = child1
- compare(item.childrenHasBeenChanged,1, "childrenChanged triggered by removing child");
-
- verify(item.parent == viewport, "root item (B)")
- verify(child1.parent == item, "child1's parent (B)")
- verify(child2.parent == child1, "child2's parent (B)")
- compare(child1.children.length, 1, "child1 children (B)")
- verify(indexOf(item.children, child1) != -1, "item.children contains child1 (B)")
- verify(indexOf(item.children, child2) == -1, "reparented child not removed from old parent (B)");
- verify(indexOf(child1.children, child2) != -1, "child1.children contains child2");
-
- // Change the parent back and test again
- child2.parent = item
- compare(item.childrenHasBeenChanged,2, "childrenChanged triggered by re-adding child");
-
- verify(item.parent == viewport, "root item after revert")
- verify(child1.parent == item, "child1 item after revert")
- verify(child2.parent == item, "child2 item after revert")
- compare(child1.children.length, 0, "child1 has no children after revert")
-
- verify(indexOf(item.children, child1) != -1, "item.children contains child1 after revert");
- verify(indexOf(item.children, child2) != -1, "item.children contains child2 after revert");
- verify(indexOf(child1.children, child2) == -1, "child1.children does not contain child2 after revert");
- }
-
- function test_sortChildren()
- {
- verify(item.sortChildren == Item3D.DefaultSorting, "default value")
- item.sortChildren = Item3D.BackToFront;
- verify(item.sortChildren == Item3D.BackToFront, "back-to-front")
- verify(item.onSortChildrenSignalTriggered, "sortChildren signal")
- }
- }
- }
-}
diff --git a/tests/auto/qml3d/item3d/tst_item3d_local_v_world.qml b/tests/auto/qml3d/item3d/tst_item3d_local_v_world.qml
deleted file mode 100644
index 940bbd99..00000000
--- a/tests/auto/qml3d/item3d/tst_item3d_local_v_world.qml
+++ /dev/null
@@ -1,213 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
-
- Item3D {
- id: rotateTestItem
- Item3D {
- id: rotateTestItemChild
- transform: Rotation3D {angle: 90 ; axis: Qt.vector3d(0,1,0)}
- }
- transform: Rotation3D {angle: 90 ; axis: Qt.vector3d(0,1,0)}
- }
-
- Item3D {
- id: rotateZTestItem
- Item3D {
- id: rotateZChild
- }
- transform: Rotation3D {angle: 90 ; axis: Qt.vector3d(0,0,1)}
- }
-
- Item3D {
- id: scaleTestItem
- Item3D {
- id: scaleTestItemChild
- transform: Scale3D { scale: 0.5 }
- }
- transform: Scale3D { scale: 2.0 }
- }
-
- Item3D {
- id: translateTestItem
- position: Qt.vector3d(1,1,1)
-
- Item3D {
- id: child
- position: Qt.vector3d(1,1,1)
- }
-
- TestCase {
- name: "Item3DRelativeTransformTests"
-
- function test_localToWorld_translate()
- {
- var testVectorNull = Qt.vector3d(0,0,0);
- var resultVector = translateTestItem.localToWorld(testVectorNull);
-
- compare(resultVector.x, translateTestItem.position.x, "testVectorNull x translation");
- compare(resultVector.y, translateTestItem.position.y, "testVectorNull y translation");
- compare(resultVector.z, translateTestItem.position.z, "testVectorNull z translation");
-
- var childResult = child.localToWorld(testVectorNull);
- compare(childResult.x, translateTestItem.x + child.x, "child testVectorNull x translation");
- compare(childResult.y, translateTestItem.y + child.y, "child testVectorNull y translation");
- compare(childResult.z, translateTestItem.z + child.z, "child testVectorNull z translation");
-
- var testVector2 = Qt.vector3d(-1,0,123456);
- var childResult2 = child.localToWorld(testVector2);
- compare(childResult2.x, translateTestItem.x + child.x + testVector2.x, "non-zero point, x translation");
- compare(childResult2.y, translateTestItem.y + child.y, "non-zero point, y translation");
- compare(childResult2.z, translateTestItem.z + child.z + testVector2.z, "non-zero point, z translation");
- }
-
- function test_localToWorld_rotate()
- {
- var testVectorX = Qt.vector3d(1,0,0);
- var resultVector = rotateTestItem.localToWorld(testVectorX);
- compare(resultVector.x, 0, "x value of testVectorX rotated 90 degrees around y unit vector");
- compare(resultVector.y, 0, "y value of testVectorX rotated 90 degrees around y unit vector");
- compare(resultVector.z, -1, "z value of testVectorX rotated 90 degrees around y unit vector");
-
- var testVectorY = Qt.vector3d(0,1,0);
- var resultVectorY = rotateTestItem.localToWorld(testVectorY);
- compare(resultVectorY.x, 0, "x value of testVectorY rotated 90 degrees around y unit vector");
- compare(resultVectorY.y, 1, "y value of testVectorY rotated 90 degrees around y unit vector");
- compare(resultVectorY.z, 0, "z value of testVectorY rotated 90 degrees around y unit vector");
-
- var testVectorXY = Qt.vector3d(1,2,0);
- var resultVectorXY = rotateZChild.localToWorld(testVectorXY);
- compare(resultVectorXY.x, -testVectorXY.y, "x value of testVectorY rotated 90 degrees around y unit vector");
- compare(resultVectorXY.y, testVectorXY.x, "y value of testVectorY rotated 90 degrees around y unit vector");
- compare(resultVectorXY.z, testVectorXY.z, "z value of testVectorY rotated 90 degrees around y unit vector");
- }
-
- function test_localToWorld_scale()
- {
- var testVectorNull = Qt.vector3d(0,0,0);
- var testVectorX = Qt.vector3d(1,0,0);
-
- var resultVector = scaleTestItem.localToWorld(testVectorNull);
- compare(resultVector.x, 0, "x value of testVectorNull scale: 2.0");
- compare(resultVector.y, 0, "y value of testVectorNull scale: 2.0");
- compare(resultVector.z, 0, "z value of testVectorNull scale: 2.0");
-
- resultVector = scaleTestItem.localToWorld(testVectorX);
- compare(resultVector.x, 2, "testVectorX.x scale: 2.0");
- compare(resultVector.y, 0, "testVectorX.y scale: 2.0");
- compare(resultVector.z, 0, "testVectorX.z scale: 2.0");
-
- resultVector = scaleTestItemChild.localToWorld(testVectorNull);
- compare(resultVector.x, testVectorNull.x, "testVectorNull.x scaled up and back down");
- compare(resultVector.y, testVectorNull.y, "testVectorNull.y scaled up and back down");
- compare(resultVector.z, testVectorNull.z, "testVectorNull.z scaled up and back down");
-
- resultVector = scaleTestItemChild.localToWorld(testVectorX);
- compare(resultVector.x, testVectorX.x, "testVectorX.x scaled up and back down");
- compare(resultVector.y, testVectorX.y, "testVectorX.y scaled up and back down");
- compare(resultVector.z, testVectorX.z, "testVectorX.z scaled up and back down");
- }
-
- function test_worldToLocal_rotate()
- {
- var testVector = Qt.vector3d(0,0,-1);
- var resultVector = rotateTestItem.worldToLocal(testVector);
- compare(resultVector.x, 1, "x value of x unitVector rotated 90 degrees around y unit vector");
- compare(resultVector.y, 0, "y value of x unitVector rotated 90 degrees around y unit vector");
- compare(resultVector.z, 0, "z value of x unitVector rotated 90 degrees around y unit vector");
- }
-
- function test_worldToLocal_scale()
- {
- var testVectorNull = Qt.vector3d(0,0,0);
- var testVectorX = Qt.vector3d(1,0,0);
-
- var resultVector = scaleTestItem.worldToLocal(testVectorNull);
- compare(resultVector.x, 0, "x value of testVectorNull scale: 2.0");
- compare(resultVector.y, 0, "y value of testVectorNull scale: 2.0");
- compare(resultVector.z, 0, "z value of testVectorNull scale: 2.0");
-
- resultVector = scaleTestItem.worldToLocal(testVectorX);
- compare(resultVector.x, 0.5, "testVectorX.x scale: 2.0");
- compare(resultVector.y, 0, "testVectorX.y scale: 2.0");
- compare(resultVector.z, 0, "testVectorX.z scale: 2.0");
-
- resultVector = scaleTestItemChild.worldToLocal(testVectorNull);
- compare(resultVector.x, testVectorNull.x, "testVectorNull.x scaled up and back down");
- compare(resultVector.y, testVectorNull.y, "testVectorNull.y scaled up and back down");
- compare(resultVector.z, testVectorNull.z, "testVectorNull.z scaled up and back down");
-
- resultVector = scaleTestItemChild.worldToLocal(testVectorX);
- compare(resultVector.x, testVectorX.x, "testVectorX.x scaled up and back down");
- compare(resultVector.y, testVectorX.y, "testVectorX.y scaled up and back down");
- compare(resultVector.z, testVectorX.z, "testVectorX.z scaled up and back down");
- }
-
- function test_worldToLocal_translate()
- {
- var testVectorNull = Qt.vector3d(0,0,0);
- var resultVectorNull = translateTestItem.worldToLocal(testVectorNull);
-
- compare(resultVectorNull.x, -translateTestItem.position.x, "testVectorNull x translation");
- compare(resultVectorNull.y, -translateTestItem.position.y, "testVectorNull y translation");
- compare(resultVectorNull.z, -translateTestItem.position.z, "testVectorNull z translation");
-
- var childResult = child.worldToLocal(testVectorNull);
- compare(childResult.x, -translateTestItem.x - child.x, "child x translation");
- compare(childResult.y, -translateTestItem.y - child.y, "child y translation");
- compare(childResult.z, -translateTestItem.z - child.z, "child z translation");
-
- var testVector2 = Qt.vector3d(-1,0,123456);
- var childResult2 = child.worldToLocal(testVector2);
- compare(childResult2.x, testVector2.x -translateTestItem.x - child.x, "non-zero point, x translation");
- compare(childResult2.y, testVector2.y -translateTestItem.y - child.y, "non-zero point, y translation");
- compare(childResult2.z, testVector2.z -translateTestItem.z - child.z, "non-zero point, z translation");
- }
- }
- }
-}
diff --git a/tests/auto/qml3d/item3d/tst_missing_texture_coordinates.qml b/tests/auto/qml3d/item3d/tst_missing_texture_coordinates.qml
deleted file mode 100644
index 0c63ae17..00000000
--- a/tests/auto/qml3d/item3d/tst_missing_texture_coordinates.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 Qt 4.7
-import Qt3D 1.0
-
-Viewport {
- width: 1000
- height: 800
- camera: Camera {
- eye.z: 10
- }
-
- Item3D {
- id: testItem
- mesh: Mesh { source: "square.3ds" }
- effect: Effect { texture: "test_data/test-image.png" }
- }
-
- // HACK.
- // The test requires that actual drawing happen,
- // and it would be better to verify that directly.
- Timer {
- running: true
- interval: 5
- onTriggered: Qt.quit()
- }
-
- // This test is simply testing to see if the item crashes on startup,
- // so this dummy test is probably not even required
- function test_exists()
- {
- verify(testItem.visible);
- Qt.quit();
- }
-}
diff --git a/tests/auto/qml3d/lookat/tst_lookat.qml b/tests/auto/qml3d/lookat/tst_lookat.qml
deleted file mode 100644
index 7b4f1d56..00000000
--- a/tests/auto/qml3d/lookat/tst_lookat.qml
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Item3D {
- id: target1
- x: 5.0
- }
-
- Item3D {
- id: targetNegativeXAxis
- x: -5.0
- }
-
- Item3D {
- id: targetUpVector
- y: 5.0
- }
-
- Item3D {
- id: targetExpectedUpVectorTrue
- z: 5.0
- }
-
- Item3D {
- id: item1
- transform: LookAt {
- id: lookAt1
- subject: target1
- }
- Item3D {
- id: child1
- z: 5.0
- }
- }
-
- Item3D {
- id: itemNegativeXAxis
- transform: LookAt {
- id: lookAtNegativeXAxis
- subject: targetNegativeXAxis
- }
- Item3D {
- id: childNegativeXAxis
- z: 5.0
- }
- }
-
- Item3D {
- id: itemUpVector
- transform: LookAt {
- id: lookAtUpVector
- subject: targetUpVector
- }
- Item3D {
- id: childUpVector
- z: 5.0
- }
- }
-
- Item3D {
- id: itemUpVectorTrue
- transform: LookAt {
- id: lookAtUpVectorTrue
- subject: targetUpVector
- preserveUpVector: true
- }
- Item3D {
- id: childUpVectorTrue
- z: 5.0
- }
- }
-
- TestCase {
- name: "LookAt"
-
- // helper functions
- function vectorToString(vector) {
- return "Vector3D(" + vector.x + ", " + vector.y + ", " + vector.z + ")";
- }
-
- function compareVectors(vector1, vector2, string )
- {
- compare(vector1.x, vector2.x, string + " x");
- compare(vector1.y, vector2.y, string + " y");
- compare(vector1.z, vector2.z, string + " z");
- }
-
- function test_lookAt() {
- var testPosition = child1.localToWorld();
- var targetPosition = target1.localToWorld();
- compare(testPosition.x, targetPosition.x, "test lookAt along X axis: x");
- compare(testPosition.y, targetPosition.y, "test lookAt along X axis: y");
- compare(testPosition.z, targetPosition.z, "test lookAt along X axis: z");
-
- testPosition = childNegativeXAxis.localToWorld();
- targetPosition = targetNegativeXAxis.localToWorld();
- compare(testPosition.x, targetPosition.x, "test negativeXAxis: x");
- compare(testPosition.y, targetPosition.y, "test negativeXAxis: y");
- compare(testPosition.z, targetPosition.z, "test negativeXAxis: z");
-
- target1.x = -5.0;
- target1.y = -5.0;
- target1.z = -5.0;
- // Adjust the child's Z offset to match the new target position
- child1.z = Math.sqrt(target1.x*target1.x + target1.y*target1.y +
- target1.z*target1.z);
-
- testPosition = child1.localToWorld();
- targetPosition = target1.localToWorld();
-
- skip("comparing reals is too precise");
- // compare is fuzzy by default
- compare(testPosition.x, targetPosition.x, "test subject position change: x");
- compare(testPosition.y, targetPosition.y, "test subject position change: y");
- compare(testPosition.z, targetPosition.z, "test subject position change: z");
- }
-
- function test_preserveUpVector() {
- compare(lookAtUpVector.preserveUpVector, false, "default preserveUpVector is false");
-
- // Verify that the lookAt works:
- var childUpVectorPosition = childUpVector.localToWorld();
- var targetUpVectorPosition = targetUpVector.localToWorld();
- compareVectors(childUpVectorPosition, targetUpVectorPosition, "preserveUpVector false");
-
- var targetUpVectorPosition = targetUpVector.localToWorld();
- var childUpVectorTruePosition = childUpVectorTrue.localToWorld();
- var expectedUpVectorTruePosition =
- targetExpectedUpVectorTrue.localToWorld();
-
- compareVectors(childUpVectorTruePosition,
- expectedUpVectorTruePosition,
- "preserveUpVector true" );
-
- // test that changing preserveUpVector works
- lookAtUpVector.preserveUpVector = true;
- compare(lookAtUpVector.preserveUpVector, true, "setPreserveUpVector(true)");
- childUpVectorPosition = childUpVector.localToWorld();
- compareVectors(childUpVectorPosition, expectedUpVectorTruePosition, "preserveUpVector set to true ");
-
- lookAtUpVector.preserveUpVector = false;
- compare(lookAtUpVector.preserveUpVector, false, "setPreserveUpVector(false)");
- var childUpVectorSetFalsePosition = childUpVector.localToWorld();
- compareVectors(childUpVectorSetFalsePosition,
- targetUpVectorPosition,
- "preserveUpVector set to false ");
- return;
- }
- }
-}
diff --git a/tests/auto/qml3d/mesh/test_data/teapot.bez b/tests/auto/qml3d/mesh/test_data/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/tests/auto/qml3d/mesh/test_data/teapot.bez
+++ /dev/null
@@ -1,340 +0,0 @@
-32
-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
-4,17,18,19,8,20,21,22,12,23,24,25,16,26,27,28
-19,29,30,31,22,32,33,34,25,35,36,37,28,38,39,40
-31,41,42,1,34,43,44,5,37,45,46,9,40,47,48,13
-13,14,15,16,49,50,51,52,53,54,55,56,57,58,59,60
-16,26,27,28,52,61,62,63,56,64,65,66,60,67,68,69
-28,38,39,40,63,70,71,72,66,73,74,75,69,76,77,78
-40,47,48,13,72,79,80,49,75,81,82,53,78,83,84,57
-57,58,59,60,85,86,87,88,89,90,91,92,93,94,95,96
-60,67,68,69,88,97,98,99,92,100,101,102,96,103,104,105
-69,76,77,78,99,106,107,108,102,109,110,111,105,112,113,114
-78,83,84,57,108,115,116,85,111,117,118,89,114,119,120,93
-121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136
-124,137,138,121,128,139,140,125,132,141,142,129,136,143,144,133
-133,134,135,136,145,146,147,148,149,150,151,152,69,153,154,155
-136,143,144,133,148,156,157,145,152,158,159,149,155,160,161,69
-162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177
-165,178,179,162,169,180,181,166,173,182,183,170,177,184,185,174
-174,175,176,177,186,187,188,189,190,191,192,193,194,195,196,197
-177,184,185,174,189,198,199,186,193,200,201,190,197,202,203,194
-204,204,204,204,207,208,209,210,211,211,211,211,212,213,214,215,4
-204,204,204,204,210,217,218,219,211,211,211,211,215,220,221,222,4
-204,204,204,204,219,224,225,226,211,211,211,211,222,227,228,229,4
-204,204,204,204,226,230,231,207,211,211,211,211,229,232,233,212,4
-212,213,214,215,234,235,236,237,238,239,240,241,242,243,244,245
-215,220,221,222,237,246,247,248,241,249,250,251,245,252,253,254
-222,227,228,229,248,255,256,257,251,258,259,260,254,261,262,263
-229,232,233,212,257,264,265,234,260,266,267,238,263,268,269,242
-270,270,270,270,279,280,281,282,275,276,277,278,271,272,273,274,4
-270,270,270,270,282,289,290,291,278,286,287,288,274,283,284,285,4
-270,270,270,270,291,298,299,300,288,295,296,297,285,292,293,294,4
-270,270,270,270,300,305,306,279,297,303,304,275,294,301,302,271,4
-306
-0.700000,0.450000,-0.000000
-0.700000,0.450000,0.392000
-0.392000,0.450000,0.700000
-0.000000,0.450000,0.700000
-0.668750,0.515625,-0.000000
-0.668750,0.515625,0.374500
-0.374500,0.515625,0.668750
-0.000000,0.515625,0.668750
-0.718750,0.515625,-0.000000
-0.718750,0.515625,0.402500
-0.402500,0.515625,0.718750
-0.000000,0.515625,0.718750
-0.750000,0.450000,-0.000000
-0.750000,0.450000,0.420000
-0.420000,0.450000,0.750000
-0.000000,0.450000,0.750000
--0.392000,0.450000,0.700000
--0.700000,0.450000,0.392000
--0.700000,0.450000,-0.000000
--0.374500,0.515625,0.668750
--0.668750,0.515625,0.374500
--0.668750,0.515625,-0.000000
--0.402500,0.515625,0.718750
--0.718750,0.515625,0.402500
--0.718750,0.515625,-0.000000
--0.420000,0.450000,0.750000
--0.750000,0.450000,0.420000
--0.750000,0.450000,-0.000000
--0.700000,0.450000,-0.392000
--0.392000,0.450000,-0.700000
-0.000000,0.450000,-0.700000
--0.668750,0.515625,-0.374500
--0.374500,0.515625,-0.668750
-0.000000,0.515625,-0.668750
--0.718750,0.515625,-0.402500
--0.402500,0.515625,-0.718750
-0.000000,0.515625,-0.718750
--0.750000,0.450000,-0.420000
--0.420000,0.450000,-0.750000
-0.000000,0.450000,-0.750000
-0.392000,0.450000,-0.700000
-0.700000,0.450000,-0.392000
-0.374500,0.515625,-0.668750
-0.668750,0.515625,-0.374500
-0.402500,0.515625,-0.718750
-0.718750,0.515625,-0.402500
-0.420000,0.450000,-0.750000
-0.750000,0.450000,-0.420000
-0.875000,0.187500,-0.000000
-0.875000,0.187500,0.490000
-0.490000,0.187500,0.875000
-0.000000,0.187500,0.875000
-1.000000,-0.075000,-0.000000
-1.000000,-0.075000,0.560000
-0.560000,-0.075000,1.000000
-0.000000,-0.075000,1.000000
-1.000000,-0.300000,-0.000000
-1.000000,-0.300000,0.560000
-0.560000,-0.300000,1.000000
-0.000000,-0.300000,1.000000
--0.490000,0.187500,0.875000
--0.875000,0.187500,0.490000
--0.875000,0.187500,-0.000000
--0.560000,-0.075000,1.000000
--1.000000,-0.075000,0.560000
--1.000000,-0.075000,-0.000000
--0.560000,-0.300000,1.000000
--1.000000,-0.300000,0.560000
--1.000000,-0.300000,-0.000000
--0.875000,0.187500,-0.490000
--0.490000,0.187500,-0.875000
-0.000000,0.187500,-0.875000
--1.000000,-0.075000,-0.560000
--0.560000,-0.075000,-1.000000
-0.000000,-0.075000,-1.000000
--1.000000,-0.300000,-0.560000
--0.560000,-0.300000,-1.000000
-0.000000,-0.300000,-1.000000
-0.490000,0.187500,-0.875000
-0.875000,0.187500,-0.490000
-0.560000,-0.075000,-1.000000
-1.000000,-0.075000,-0.560000
-0.560000,-0.300000,-1.000000
-1.000000,-0.300000,-0.560000
-1.000000,-0.525000,-0.000000
-1.000000,-0.525000,0.560000
-0.560000,-0.525000,1.000000
-0.000000,-0.525000,1.000000
-0.750000,-0.637500,-0.000000
-0.750000,-0.637500,0.420000
-0.420000,-0.637500,0.750000
-0.000000,-0.637500,0.750000
-0.750000,-0.675000,-0.000000
-0.750000,-0.675000,0.420000
-0.420000,-0.675000,0.750000
-0.000000,-0.675000,0.750000
--0.560000,-0.525000,1.000000
--1.000000,-0.525000,0.560000
--1.000000,-0.525000,-0.000000
--0.420000,-0.637500,0.750000
--0.750000,-0.637500,0.420000
--0.750000,-0.637500,-0.000000
--0.420000,-0.675000,0.750000
--0.750000,-0.675000,0.420000
--0.750000,-0.675000,-0.000000
--1.000000,-0.525000,-0.560000
--0.560000,-0.525000,-1.000000
-0.000000,-0.525000,-1.000000
--0.750000,-0.637500,-0.420000
--0.420000,-0.637500,-0.750000
-0.000000,-0.637500,-0.750000
--0.750000,-0.675000,-0.420000
--0.420000,-0.675000,-0.750000
-0.000000,-0.675000,-0.750000
-0.560000,-0.525000,-1.000000
-1.000000,-0.525000,-0.560000
-0.420000,-0.637500,-0.750000
-0.750000,-0.637500,-0.420000
-0.420000,-0.675000,-0.750000
-0.750000,-0.675000,-0.420000
--0.800000,0.262500,-0.000000
--0.800000,0.262500,0.150000
--0.750000,0.375000,0.150000
--0.750000,0.375000,-0.000000
--1.150000,0.262500,-0.000000
--1.150000,0.262500,0.150000
--1.250000,0.375000,0.150000
--1.250000,0.375000,-0.000000
--1.350000,0.262500,-0.000000
--1.350000,0.262500,0.150000
--1.500000,0.375000,0.150000
--1.500000,0.375000,-0.000000
--1.350000,0.150000,-0.000000
--1.350000,0.150000,0.150000
--1.500000,0.150000,0.150000
--1.500000,0.150000,-0.000000
--0.750000,0.375000,-0.150000
--0.800000,0.262500,-0.150000
--1.250000,0.375000,-0.150000
--1.150000,0.262500,-0.150000
--1.500000,0.375000,-0.150000
--1.350000,0.262500,-0.150000
--1.500000,0.150000,-0.150000
--1.350000,0.150000,-0.150000
--1.350000,0.037500,-0.000000
--1.350000,0.037500,0.150000
--1.500000,-0.075000,0.150000
--1.500000,-0.075000,-0.000000
--1.250000,-0.187500,-0.000000
--1.250000,-0.187500,0.150000
--1.325000,-0.281250,0.150000
--1.325000,-0.281250,-0.000000
--1.000000,-0.300000,0.150000
--0.950000,-0.450000,0.150000
--0.950000,-0.450000,-0.000000
--1.500000,-0.075000,-0.150000
--1.350000,0.037500,-0.150000
--1.325000,-0.281250,-0.150000
--1.250000,-0.187500,-0.150000
--0.950000,-0.450000,-0.150000
--1.000000,-0.300000,-0.150000
-0.850000,-0.037500,-0.000000
-0.850000,-0.037500,0.330000
-0.850000,-0.450000,0.330000
-0.850000,-0.450000,-0.000000
-1.300000,-0.037500,-0.000000
-1.300000,-0.037500,0.330000
-1.550000,-0.337500,0.330000
-1.550000,-0.337500,-0.000000
-1.150000,0.300000,-0.000000
-1.150000,0.300000,0.125000
-1.200000,0.262500,0.125000
-1.200000,0.262500,-0.000000
-1.350000,0.450000,-0.000000
-1.350000,0.450000,0.125000
-1.650000,0.450000,0.125000
-1.650000,0.450000,-0.000000
-0.850000,-0.450000,-0.330000
-0.850000,-0.037500,-0.330000
-1.550000,-0.337500,-0.330000
-1.300000,-0.037500,-0.330000
-1.200000,0.262500,-0.125000
-1.150000,0.300000,-0.125000
-1.650000,0.450000,-0.125000
-1.350000,0.450000,-0.125000
-1.400000,0.487500,-0.000000
-1.400000,0.487500,0.125000
-1.762500,0.496875,0.125000
-1.762500,0.496875,-0.000000
-1.450000,0.487500,-0.000000
-1.450000,0.487500,0.075000
-1.725000,0.506250,0.075000
-1.725000,0.506250,-0.000000
-1.400000,0.450000,-0.000000
-1.400000,0.450000,0.075000
-1.600000,0.450000,0.075000
-1.600000,0.450000,-0.000000
-1.762500,0.496875,-0.125000
-1.400000,0.487500,-0.125000
-1.725000,0.506250,-0.075000
-1.450000,0.487500,-0.075000
-1.600000,0.450000,-0.075000
-1.400000,0.450000,-0.075000
-0.000000,0.825000,-0.000000
-0.000000,0.825000,0.001000
-0.001000,0.825000,-0.000000
-0.400000,0.825000,-0.000000
-0.400000,0.825000,0.225000
-0.225000,0.825000,0.400000
-0.000000,0.825000,0.400000
-0.000000,0.675000,-0.000000
-0.100000,0.600000,-0.000000
-0.100000,0.600000,0.056000
-0.056000,0.600000,0.100000
-0.000000,0.600000,0.100000
--0.001000,0.825000,-0.000000
--0.225000,0.825000,0.400000
--0.400000,0.825000,0.225000
--0.400000,0.825000,-0.000000
--0.056000,0.600000,0.100000
--0.100000,0.600000,0.056000
--0.100000,0.600000,-0.000000
-0.000000,0.825000,-0.001000
--0.400000,0.825000,-0.225000
--0.225000,0.825000,-0.400000
-0.000000,0.825000,-0.400000
--0.100000,0.600000,-0.056000
--0.056000,0.600000,-0.100000
-0.000000,0.600000,-0.100000
-0.225000,0.825000,-0.400000
-0.400000,0.825000,-0.225000
-0.056000,0.600000,-0.100000
-0.100000,0.600000,-0.056000
-0.200000,0.525000,-0.000000
-0.200000,0.525000,0.112000
-0.112000,0.525000,0.200000
-0.000000,0.525000,0.200000
-0.650000,0.525000,-0.000000
-0.650000,0.525000,0.364000
-0.364000,0.525000,0.650000
-0.000000,0.525000,0.650000
-0.650000,0.450000,-0.000000
-0.650000,0.450000,0.364000
-0.364000,0.450000,0.650000
-0.000000,0.450000,0.650000
--0.112000,0.525000,0.200000
--0.200000,0.525000,0.112000
--0.200000,0.525000,-0.000000
--0.364000,0.525000,0.650000
--0.650000,0.525000,0.364000
--0.650000,0.525000,-0.000000
--0.364000,0.450000,0.650000
--0.650000,0.450000,0.364000
--0.650000,0.450000,-0.000000
--0.200000,0.525000,-0.112000
--0.112000,0.525000,-0.200000
-0.000000,0.525000,-0.200000
--0.650000,0.525000,-0.364000
--0.364000,0.525000,-0.650000
-0.000000,0.525000,-0.650000
--0.650000,0.450000,-0.364000
--0.364000,0.450000,-0.650000
-0.000000,0.450000,-0.650000
-0.112000,0.525000,-0.200000
-0.200000,0.525000,-0.112000
-0.364000,0.525000,-0.650000
-0.650000,0.525000,-0.364000
-0.364000,0.450000,-0.650000
-0.650000,0.450000,-0.364000
-0.000000,-0.750000,-0.000000
-0.750000,-0.675000,-0.000000
-0.750000,-0.675000,-0.420000
-0.420000,-0.675000,-0.750000
-0.000000,-0.675000,-0.750000
-0.750000,-0.712500,-0.000000
-0.750000,-0.712500,-0.420000
-0.420000,-0.712500,-0.750000
-0.000000,-0.712500,-0.750000
-0.712500,-0.750000,-0.000000
-0.712500,-0.750000,-0.399000
-0.399000,-0.750000,-0.712500
-0.000000,-0.750000,-0.712500
--0.420000,-0.675000,-0.750000
--0.750000,-0.675000,-0.420000
--0.750000,-0.675000,-0.000000
--0.420000,-0.712500,-0.750000
--0.750000,-0.712500,-0.420000
--0.750000,-0.712500,-0.000000
--0.399000,-0.750000,-0.712500
--0.712500,-0.750000,-0.399000
--0.712500,-0.750000,-0.000000
--0.750000,-0.675000,0.420000
--0.420000,-0.675000,0.750000
-0.000000,-0.675000,0.750000
--0.750000,-0.712500,0.420000
--0.420000,-0.712500,0.750000
-0.000000,-0.712500,0.750000
--0.712500,-0.750000,0.399000
--0.399000,-0.750000,0.712500
-0.000000,-0.750000,0.712500
-0.420000,-0.675000,0.750000
-0.750000,-0.675000,0.420000
-0.420000,-0.712500,0.750000
-0.750000,-0.712500,0.420000
-0.399000,-0.750000,0.712500
-0.712500,-0.750000,0.399000
diff --git a/tests/auto/qml3d/mesh/tst_mesh.qml b/tests/auto/qml3d/mesh/tst_mesh.qml
deleted file mode 100644
index c132f381..00000000
--- a/tests/auto/qml3d/mesh/tst_mesh.qml
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Mesh {
- id: url_test_mesh
- source: ""
- onDataChanged: { dataChangedCounter += 1 }
- property int dataChangedCounter: 0
- }
-
- Mesh {
- id: meshName_test_mesh
- onDataChanged: { dataChangedCounter += 1 }
- property int dataChangedCounter: 0
- }
-
- Mesh {
- id: meshName_test_mesh2
- meshName: "testName"
- onDataChanged: { dataChangedCounter += 1 }
- property int dataChangedCounter: 0
- }
-
- Mesh {
- id: options_test_mesh
- onOptionsChanged: { optionsChangedCounter += 1}
- property int optionsChangedCounter: 0
- }
-
- TestCase {
- name: "Mesh"
- id: meshTest
-
- function test_url() {
- compare(url_test_mesh.dataChangedCounter, 0, "pre-test counter validation")
- compare(url_test_mesh.source, "", "null default source")
-
-
- var testString = "test_data/teapot.bez";
- url_test_mesh.source = testString;
-
- // QUrl contains the absolute file path, so just compare the end
- var substring = url_test_mesh.source.toString().substr(-testString.length,testString.length);
- compare(substring, testString, "setSource() (relative file path)");
- compare(url_test_mesh.dataChangedCounter, 1, "dataChanged signal")
- }
-
- function test_meshName() {
- meshName_test_mesh.dataChangedCounter = 0;
- compare(meshName_test_mesh.dataChangedCounter, 0, "pre-test counter validation")
-
- compare(meshName_test_mesh.meshName, "", "null default meshName");
- compare(meshName_test_mesh2.meshName, "testName", "qml assignment test");
-
- meshName_test_mesh.meshName = "setMeshNameTestName";
- compare(meshName_test_mesh.meshName, "setMeshNameTestName", "setMeshNameTestName");
- compare(meshName_test_mesh.dataChangedCounter, 1, "dataChanged signal")
- }
-
- function test_options() {
- compare(options_test_mesh.optionsChangedCounter, 0,
- "pretest validation")
- compare(options_test_mesh.options, "", "null default options");
-
- options_test_mesh.options="test options string";
- compare(options_test_mesh.options, "test options string",
- "setOptionsString");
-
- options_test_mesh.options="test options string";
- compare(options_test_mesh.options, "test options string",
- "setOptions()");
- compare(options_test_mesh.optionsChangedCounter, 1,
- "optionsChanged signal 1");
-
- options_test_mesh.options=" \\ \ \$";
- compare(options_test_mesh.options, " \\ \ \$",
- "potentially troublesome characters")
- compare(options_test_mesh.optionsChangedCounter, 2,
- "optionsChanged signal 2");
- }
- }
-}
diff --git a/tests/auto/qml3d/modelview/textures/amethyst.jpg b/tests/auto/qml3d/modelview/textures/amethyst.jpg
deleted file mode 100644
index 43a2c440..00000000
--- a/tests/auto/qml3d/modelview/textures/amethyst.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/textures/bigblue.jpg b/tests/auto/qml3d/modelview/textures/bigblue.jpg
deleted file mode 100644
index 8a0bb653..00000000
--- a/tests/auto/qml3d/modelview/textures/bigblue.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/textures/blueweb.jpg b/tests/auto/qml3d/modelview/textures/blueweb.jpg
deleted file mode 100644
index 68f3d350..00000000
--- a/tests/auto/qml3d/modelview/textures/blueweb.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/textures/pastelstuff.jpg b/tests/auto/qml3d/modelview/textures/pastelstuff.jpg
deleted file mode 100644
index 82da86e0..00000000
--- a/tests/auto/qml3d/modelview/textures/pastelstuff.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/textures/qtlogo.png b/tests/auto/qml3d/modelview/textures/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/tests/auto/qml3d/modelview/textures/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/textures/threedgreen.jpg b/tests/auto/qml3d/modelview/textures/threedgreen.jpg
deleted file mode 100644
index 7624527f..00000000
--- a/tests/auto/qml3d/modelview/textures/threedgreen.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/modelview/tst_modelview.qml b/tests/auto/qml3d/modelview/tst_modelview.qml
deleted file mode 100644
index f7752e85..00000000
--- a/tests/auto/qml3d/modelview/tst_modelview.qml
+++ /dev/null
@@ -1,274 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle
-{
- id: topLevel
- width: 480; height: 480
-
- Viewport {
- id: viewport
- picking: true
- anchors.fill: parent
-
- camera: Camera {
- id: main_camera
- eye: Qt.vector3d(0, 4, 12)
- center: Qt.vector3d(0, 0, -2.5)
- }
-
- property variant emptyStringListModel:[]
-
- property variant stringListModelForViewport:[
- "textures/threedgreen.jpg",
- "textures/amethyst.jpg",
- "textures/bigblue.jpg",
- "textures/pastelstuff.jpg",
- "textures/blueweb.jpg",
- "textures/qtlogo.png"
- ]
-
- property variant stringListModelEmptyForItem: []
-
- property variant stringListModelForItem:[
- "textures/amethyst.jpg",
- "textures/pastelstuff.jpg",
- "textures/bigblue.jpg",
- "textures/qtlogo.png",
- "textures/blueweb.jpg",
- "textures/threedgreen.jpg"
- ]
-
- ListModel {
- id: listModelForViewport
- ListElement { image:"textures/threedgreen.jpg"}
- ListElement { image:"textures/amethyst.jpg"}
- ListElement { image:"textures/bigblue.jpg"}
- ListElement { image:"textures/pastelstuff.jpg"}
- ListElement { image:"textures/blueweb.jpg"}
- ListElement { image:"textures/qtlogo.png"}
- }
-
- ListModel {
- id: listModelForItem
- ListElement { image:"textures/amethyst.jpg"}
- ListElement { image:"textures/pastelstuff.jpg"}
- ListElement { image:"textures/bigblue.jpg"}
- ListElement { image:"textures/qtlogo.png"}
- ListElement { image:"textures/blueweb.jpg"}
- ListElement { image:"textures/threedgreen.jpg"}
- }
-
- Component {
- id: paneComponentstringList
- Quad {
- property real layer: index
- property variant image : modelData
- position: Qt.vector3d(0, 0, -layer)
- effect: Effect { decal: true; texture: image }
- transform: Rotation3D { axis: Qt.vector3d(1,0,0); angle: 90 }
- }
- }
-
- Component {
- id: paneComponentListModel
- Quad {
- position: Qt.vector3d(index * 0.1, 0, -index)
- enabled: index != -1
- effect: Effect { decal: true;
- texture: model.image;
- }
- transform: Rotation3D { axis: Qt.vector3d(1,0,0); angle: 90 }
- }
- }
-
- Repeater {
- id: stringListModelRepeaterInViewport
- delegate: paneComponentstringList
- model: parent.stringListModelEmpty
- }
-
- Repeater {
- id: listModelRepeaterInViewport
- delegate: paneComponentListModel
- model: listModelForViewport
- }
-
- Item3D {
- id: stringListModelParentItem
- x: -2.1
- Repeater {
- id: stringListModelRepeaterInItem
- delegate: paneComponentstringList
- model: viewport.stringListModelEmpty
- }
- }
-
- Item3D {
- id: listModelParentItem
- x: 2.1
- y: 0.5
-
- Repeater {
- id: listModelRepeaterInItem
- delegate: paneComponentListModel
- model: listModelForItem
- }
- }
-
- TestCase {
- id: modelViewTestAddingCase
-// when: false
- name: "Quick3d ModelView Adding Data Test"
-
- function test_changing_stringList_model() {
- var viewportEmptyModelChildCount = viewport.children.length;
- var itemEmptyModelChildCount =
- stringListModelParentItem.children.length;
- var modelLength = viewport.stringListModelForViewport.length;
-
- stringListModelRepeaterInViewport.model =
- viewport.stringListModelForViewport;
-
- verify(viewport.children.length >
- viewportEmptyModelChildCount,
- "Children not added to viewport with changed stringList model");
- compare(viewport.children.length,
- viewportEmptyModelChildCount +
- viewport.stringListModelForViewport.length,
- "Viewport has unexpected number of new children");
-
- stringListModelRepeaterInItem.model =
- viewport.stringListModelForItem;
-
- skip("modelview/item3d children tests need porting");
- verify(stringListModelParentItem.children.length >
- itemEmptyModelChildCount,
- "Children not added to Item3D with changed stringList model");
- compare(stringListModelParentItem.children.length,
- itemEmptyModelChildCount +
- viewport.stringListModelForItem.length,
- "Item3D has unexpected number of new children");
- }
-
- function test_adding_to_listModel() {
- skip("'QQuickItem::stackBefore: Cannot stack before 0x9e69f50, which must be a sibling' warning");
- var viewportChildCount = viewport.children.length;
- var itemChildCount = listModelParentItem.children.length;
-
- listModelForViewport.append({"image":"textures/pastelstuff.jpg"});
- listModelForItem.append({"image":"textures/pastelstuff.jpg"});
- viewport.update3d();
- compare(viewport.children.length, viewportChildCount + 1,
- "Viewport missing child after listModel.append()");
- compare(listModelParentItem.children.length,
- itemChildCount + 1,
- "Item3D missing child after listModel.append()");
- }
- }
-
- // This timer is to avoid an issue where removing children is
- // delayed during initialization.
- Timer {
- running: true
- interval: 1
- onTriggered: modelViewRemovingItemsTestCase.when = true;
- }
-
- TestCase {
- id: modelViewRemovingItemsTestCase
- // Wait for event loop before performing removal tests
- when: false
- name: "Quick3d ModelView Removing Data Test"
-
- function test_removing_from_listModel() {
- var viewportChildCount = viewport.children.length;
- var itemChildCount = listModelParentItem.children.length;
-
- skip("error removing element from listModelForViewport");
- listModelForViewport.remove(listModelForViewport.count - 1);
- compare(viewport.children.length, viewportChildCount -1,
- "Viewport has extra children after listModel.remove()")
-
- listModelForItem.remove(listModelForItem.count -1);
- compare(listModelParentItem.children.length,
- itemChildCount - 1,
- "Item3D has extra children after listModel.remove()");
- }
-
- function test_clearing_stringList() {
- stringListModelRepeaterInViewport.model =
- viewport.stringListModelForViewport;
- stringListModelRepeaterInItem.model =
- viewport.stringListModelForItem;
-
- var viewportChildCount = viewport.children.length;
- var itemChildCount = stringListModelParentItem.children.length;
-
- stringListModelRepeaterInViewport.model =
- viewport.emptyStringListModel;
- stringListModelRepeaterInItem.model =
- viewport.emptyStringListModel;
-
- verify(viewport.children.length < viewportChildCount,
- "Children not removed from viewport when clearing stringList model");
- compare(viewport.children.length,
- viewportChildCount -
- viewport.stringListModelForViewport.length,
- "Unexpected number of children after setting empty model");
-
- skip("modelview/item3d children tests need porting");
- verify(stringListModelParentItem.children.length <
- itemChildCount,
- "Children not removed from Item3D when clearing stringList model");
- compare(stringListModelParentItem.children.length,
- itemChildCount -
- viewport.stringListModelForItem.length,
- "Unexpected number of children after setting empty model");
- }
- }
- }
-}
diff --git a/tests/auto/qml3d/picking/tst_picking.qml b/tests/auto/qml3d/picking/tst_picking.qml
deleted file mode 100644
index 26fed38d..00000000
--- a/tests/auto/qml3d/picking/tst_picking.qml
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle
-{
- id: topLevel
- width: 480; height: 480
-
- Viewport {
- id: viewport
- width: 480; height: 480
- picking: true
-
- Quad {
- id: fullScreenQuad
-
- transform: [
- Rotation3D {
- axis: Qt.vector3d(1,0,0);
- angle: 90
- },
- Scale3D {
- // a scale 2 quad will fill a square viewport
- scale: 2
- }
- ]
- position: Qt.vector3d(0, 0, 0)
- property color color: "#ff0000"
-
- effect: Effect {
- color: fullScreenQuad.color
- }
- }
-
- Quad {
- id: smallerQuad
-
- transform: [
- Rotation3D {
- axis: Qt.vector3d(1,0,0);
- angle: 90
- },
- // Bring quad forwards a little bit to ensure it's drawn
- Translation3D { translate: Qt.vector3d(0,0,0.1)}
- ]
-
- position: Qt.vector3d(0, 0, 0)
- property color color: "#0000ff"
-
- effect: Effect {
- color: smallerQuad.color
- }
- }
-
- Component {
- id: pickTestDelegate
- Quad {
- objectName: "foo"
- transform: [
- Rotation3D {
- axis: Qt.vector3d(1,0,0);
- angle: 90
- },
- // Bring quad forwards a little bit to ensure it's drawn
- Translation3D { translate: Qt.vector3d(0,0,0.1)}
- ]
-
- // Ensure items are above smallerQuad
- position: Qt.vector3d(0, 0, (index + 1) * 0.1)
- property color color: model.color
- }
- }
-
- ListModel{
- id: pickTestModel
- }
-
- Repeater {
- delegate: pickTestDelegate
- model: pickTestModel
- }
-
- // picking fails until the first paint occurs. There's no
- // straight-forward way to wait for the first paint, so we'll use a
- // timer to allow the paint to happen.
-
- Timer {
- id: paintedTest
- running: true
- interval: 1
- repeat: true
- onTriggered: {
- var x = viewport.width / 2;
- var y = viewport.height / 2;
- // Usually succeeds on the first run
-// console.log("objectForPoint(" + x + "," + y + "): " + viewport.objectForPoint(x,y) );
- //if (viewport.objectForPoint(x,y) != null)
- // pickingTestCase.when = true;
- }
- }
-
- // Time out and fail
- Timer {
- running: true
- interval: 2000
- onTriggered: {
- pickingTestCase.timedOut = true;
- pickingTestCase.when = true;
- }
- }
-
- TestCase {
- id: pickingTestCase
- name: "Picking Test"
-
- // Delay test until after first paint
- when: false
- property bool timedOut : false
-
- property int midX : viewport.width / 2;
- property int midY : viewport.height / 2;
- function test_picking() {
- skip("picking test need porting");
- /*
- verify(viewport.objectForPoint(0,0) == fullScreenQuad,
- "Didn't find full screen quad in top left corner");
- verify(viewport.objectForPoint(midX,midY) == smallerQuad,
- "Didn't find smaller quad at midpoint");
- verify(viewport.objectForPoint(-midX,-midY) == null,
- "Incorrectly found object off viewport");
- pickTestModel.append({"color":"#00ff00"});
- verify(viewport.objectForPoint(midX,midY).color == "#00ff00",
- "Didn't find modelview quad at midpoint");
- pickTestModel.append({"color":"#ff00ff"});
- verify(viewport.objectForPoint(midX,midY).color == "#ff00ff",
- "Didn't find second modelview quad at midpoint");
- */
- }
- }
- }
-}
diff --git a/tests/auto/qml3d/qml3d.pro b/tests/auto/qml3d/qml3d.pro
deleted file mode 100644
index e03a405c..00000000
--- a/tests/auto/qml3d/qml3d.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-load(qmltestcase.prf)
-TEMPLATE=app
-TARGET=tst_qml3d
-CONFIG += warn_on
-QT += declarative opengl
-QT += qtquick1
-SOURCES += tst_qml3d.cpp
-
-DEFINES -= QUICK_TEST_SOURCE_DIR
-DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
-win32:DEFINES+=_CRT_SECURE_NO_WARNINGS
-
-OTHER_FILES += \
- lookat/tst_lookat.qml \
- scale3d/tst_scale3d.qml \
- modelview/tst_modelview.qml \
- sphere/tst_sphere.qml \
- effect/tst_effect.qml \
- viewport/tst_viewport.qml \
- mesh/tst_mesh.qml \
- picking/tst_picking.qml \
- item3d/tst_item3d.qml \
- item3d/tst_missing_texture_coordinates.qml \
- item3d/tst_item3d_local_v_world.qml \
-
-# Don't block while tests are unstable
-CONFIG+=insignificant_test
diff --git a/tests/auto/qml3d/scale3d/tst_scale3d.qml b/tests/auto/qml3d/scale3d/tst_scale3d.qml
deleted file mode 100644
index f0ac39ad..00000000
--- a/tests/auto/qml3d/scale3d/tst_scale3d.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Scale3D {
- id: scale1
- scale: 2.5
- }
-
- Scale3D {
- id: scale2
- scale: Qt.vector3d(1.0, 0.5, -2.0)
- }
-
- Scale3D {
- id: scale3
- property int changed: 0
- onScaleChanged: ++changed
- }
-
- Scale3D {
- id: scale4
- property int changed: 0
- onOriginChanged: ++changed
- }
-
- TestCase {
- name: "Scale3D"
-
- function test_uniformScale() {
- skip("Scale3D.scale confuses tests");
- compare(scale1.scale, Qt.vector3d(2.5, 2.5, 2.5), "uniform1")
- scale1.scale = 4.5
- compare(scale1.scale, Qt.vector3d(4.5, 4.5, 4.5), "uniform2")
- scale1.scale = Qt.vector3d(3.0, -2.5, 1.5)
- compare(scale1.scale, Qt.vector3d(3.0, -2.5, 1.5), "uniform3")
- }
-
- function test_nonUniformScale() {
- skip("Scale3D.scale confuses tests");
- compare(scale2.scale, Qt.vector3d(1.0, 0.5, -2.0), "nonuniform1")
- scale2.scale = Qt.vector3d(3.0, -2.5, 1.5)
- compare(scale2.scale, Qt.vector3d(3.0, -2.5, 1.5), "nonuniform2")
- scale2.scale = 4.5
- compare(scale2.scale, Qt.vector3d(4.5, 4.5, 4.5), "nonuniform3")
- }
-
- function test_scaleChanged() {
- skip("Scale3D.scale confuses tests");
- compare(scale3.scale, Qt.vector3d(1.0, 1.0, 1.0), "changed1")
- compare(scale3.changed, 0, "changed2")
- scale3.scale = Qt.vector3d(3.0, -2.5, 1.5)
- compare(scale3.scale, Qt.vector3d(3.0, -2.5, 1.5), "changed3")
- compare(scale3.changed, 1, "changed3")
- scale3.scale = 4.5
- compare(scale3.scale, Qt.vector3d(4.5, 4.5, 4.5), "changed4")
- compare(scale3.changed, 2, "changed4")
- }
-
- function test_originChanged() {
- skip("Scale3D.scale confuses tests");
- compare(scale4.origin, Qt.vector3d(0.0, 0.0, 0.0), "changed1")
- compare(scale4.changed, 0, "changed2")
- scale4.origin = Qt.vector3d(3.0, -2.5, 1.5)
- compare(scale4.origin, Qt.vector3d(3.0, -2.5, 1.5), "changed3")
- compare(scale4.changed, 1, "changed3")
- }
- }
-}
diff --git a/tests/auto/qml3d/sphere/tst_sphere.qml b/tests/auto/qml3d/sphere/tst_sphere.qml
deleted file mode 100644
index 3687e919..00000000
--- a/tests/auto/qml3d/sphere/tst_sphere.qml
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- id: viewport
-
- Sphere {
- id: sphere1
- }
-
- Sphere {
- id: sphere2
- radius: 3.5
- levelOfDetail: 2
- axis: Qt.YAxis
- }
-
- Sphere {
- id: sphere3
- radius: -3.5
- levelOfDetail: 23 // Valid, but clamped during drawing
- axis: Qt.XAxis
- }
-
- Sphere {
- id: sphere4
- property int radChanged: 0
- property int lodChanged: 0
- property int axChanged: 0
- onRadiusChanged: radChanged = radChanged + 1
- onLevelOfDetailChanged: lodChanged = lodChanged + 1
- onAxisChanged: axChanged = axChanged + 1
- }
-
- TestCase {
- name: "Sphere"
-
- function test_defaults() {
- compare(sphere1.radius, 1, "radius");
- compare(sphere1.levelOfDetail, 5, "levelOfDetail");
- compare(sphere1.axis, Qt.ZAxis, "axis");
- }
-
- function test_properties() {
- compare(sphere2.radius, 3.5, "radius");
- compare(sphere2.levelOfDetail, 2, "levelOfDetail");
- compare(sphere2.axis, Qt.YAxis, "axis");
- compare(sphere3.radius, -3.5, "radius (B)");
- compare(sphere3.levelOfDetail, 10, "levelOfDetail (B)");
- compare(sphere3.axis, Qt.XAxis, "axis (B)");
- }
-
- function test_radiusChanged() {
- skip("Crashing");
- compare(sphere4.radius, 1, "radius");
- compare(sphere4.radChanged, 0, "changed 1");
- sphere4.radius = 3.5
- compare(sphere4.radChanged, 1, "changed 2");
- compare(sphere4.radius, 3.5, "radius modified");
- sphere4.radius = 3.5
- compare(sphere4.radChanged, 1, "changed 3");
- }
-
- function test_levelOfDetailChanged() {
- skip("Crashing");
- compare(sphere4.levelOfDetail, 5, "levelOfDetail");
- compare(sphere4.lodChanged, 0, "changed 1");
- sphere4.levelOfDetail = 2
- compare(sphere4.lodChanged, 1, "changed 2");
- compare(sphere4.levelOfDetail, 2, "levelOfDetail modified");
- sphere4.levelOfDetail = 2
- compare(sphere4.lodChanged, 1, "changed 3");
- }
-
- function test_axisChanged() {
- skip("Crashing");
- compare(sphere4.axis, Qt.ZAxis, "axis");
- compare(sphere4.axChanged, 0, "changed 1");
- sphere4.axis = Qt.YAxis
- compare(sphere4.axChanged, 1, "changed 2");
- compare(sphere4.axis, Qt.YAxis, "axis modified");
- sphere4.axis = Qt.YAxis
- compare(sphere4.axChanged, 1, "changed 3");
- }
- }
-}
diff --git a/tests/auto/qml3d/tst_qml3d.cpp b/tests/auto/qml3d/tst_qml3d.cpp
deleted file mode 100644
index 3c033354..00000000
--- a/tests/auto/qml3d/tst_qml3d.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 <QtQuickTest/quicktest.h>
-
-QUICK_TEST_MAIN(qml3d)
diff --git a/tests/auto/qml3d/viewport/tst_viewport.qml b/tests/auto/qml3d/viewport/tst_viewport.qml
deleted file mode 100644
index 868131fe..00000000
--- a/tests/auto/qml3d/viewport/tst_viewport.qml
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 2.0
-import Qt3D 1.0
-import QtTest 1.0
-
-Viewport {
- id: viewport
-
- Camera {
- id: newCamera
- eye: Qt.vector3d(0, 1, 52)
- }
-
- Light {
- id: newLight
- ambientColor: "#ff00ee"
- }
-
- LightModel {
- id: newLightModel
- ambientSceneColor: "#ff00ee"
- }
-
- TestCase {
- name: "Viewport"
-
- function test_modes() {
- verify(!viewport.picking, "picking")
- verify(!viewport.showPicking, "showPicking")
- verify(viewport.navigation, "navigation")
- verify(!viewport.blending, "blending")
-
- viewport.picking = true
- viewport.showPicking = true
- viewport.navigation = false
- viewport.blending = true
-
- verify(viewport.picking, "picking-modified")
- verify(viewport.showPicking, "showPicking-modified")
- verify(!viewport.navigation, "navigation-modified")
- verify(viewport.blending, "blending-modified")
- }
-
- function test_camera() {
- skip("'Cannot convert object to primitive value' error, needs porting");
- verify(viewport.camera != null, "camera")
- verify(viewport.camera != newCamera, "camera-obj")
- compare(viewport.camera.projectionType, 0, "projectionType")
- compare(viewport.camera.eye, Qt.vector3d(0, 0, 10), "eye")
- compare(viewport.camera.center, Qt.vector3d(0, 0, 0), "center")
- compare(viewport.camera.upVector, Qt.vector3d(0, 1, 0), "upVector")
- compare(viewport.camera.fieldOfView, 0, "fieldOfView")
- compare(viewport.camera.nearPlane, 5, "nearPlane")
- compare(viewport.camera.farPlane, 1000, "farPlane")
- compare(viewport.camera.eyeSeparation, 0, "eyeSeparation")
- compare(viewport.camera.adjustForAspectRatio, true, "adjustForAspectRatio")
-
- var oldCamera = viewport.camera
-
- viewport.camera = newCamera
- verify(viewport.camera == newCamera, "newCamera")
- compare(viewport.camera.eye, Qt.vector3d(0, 1, 52), "eye-new")
-
- compare(oldCamera.eye, Qt.vector3d(0, 0, 10), "eye-old")
- }
-
- function test_light() {
- skip("'Cannot convert object to primitive value' error, needs porting");
- verify(viewport.light != null, "light")
- verify(viewport.light != newLight, "light-obj")
- compare(viewport.light.type, 0, "type-directional")
- compare(viewport.light.direction, Qt.vector3d(0, 0, 1), "direction")
- compare(viewport.light.ambientColor, "#000000", "ambientColor")
- compare(viewport.light.diffuseColor, "#ffffff", "diffuseColor")
- compare(viewport.light.specularColor, "#ffffff", "specularColor")
- compare(viewport.light.spotDirection, Qt.vector3d(0, 0, -1), "spotDirection")
- compare(viewport.light.spotExponent, 0, "spotExponent")
- compare(viewport.light.spotAngle, 180, "spotAngle")
- compare(viewport.light.constantAttenuation, 1, "constantAttenuation")
- compare(viewport.light.linearAttenuation, 0, "linearAttenuation")
- compare(viewport.light.quadraticAttenuation, 0, "quadraticAttenuation")
-
- var oldLight = viewport.light
-
- viewport.light = newLight
- verify(viewport.light == newLight, "newLight")
- compare(viewport.light.ambientColor, "#ff00ee", "ambientColor-new")
-
- compare(oldLight.ambientColor, "#000000", "ambientColor-old")
- }
-
- function test_lightModel() {
- verify(viewport.lightModel == null, "lightModel")
-
- viewport.lightModel = newLightModel
- verify(viewport.lightModel == newLightModel, "newLightModel")
- compare(viewport.lightModel.ambientSceneColor, "#ff00ee", "ambientSceneColor")
- }
- }
-}
diff --git a/tests/auto/threed/load_model/load_model.pro b/tests/auto/threed/load_model/load_model.pro
deleted file mode 100644
index 41f728a2..00000000
--- a/tests/auto/threed/load_model/load_model.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_load_model
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_load_model.cpp
-
-RESOURCES += \
- load_model.qrc
diff --git a/tests/auto/threed/load_model/load_model.qrc b/tests/auto/threed/load_model/load_model.qrc
deleted file mode 100644
index 5bb2fec0..00000000
--- a/tests/auto/threed/load_model/load_model.qrc
+++ /dev/null
@@ -1,13 +0,0 @@
-<RCC>
- <qresource prefix="/data">
- <file>models/basic-cube.3ds</file>
- <file>models/basic-cube.blend</file>
- <file>models/basic-cube.mtl</file>
- <file>models/basic-cube.obj</file>
- <file>models/wave.obj</file>
- <file>models/basic-cube.m3g</file>
- <file>models/basic-cube.ply</file>
- <file>models/basic-cube.x3d</file>
- <file>models/basic-cube.dae</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/threed/load_model/models/basic-cube.3ds b/tests/auto/threed/load_model/models/basic-cube.3ds
deleted file mode 100644
index fbd4c072..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/auto/threed/load_model/models/basic-cube.blend b/tests/auto/threed/load_model/models/basic-cube.blend
deleted file mode 100644
index 663e17de..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.blend
+++ /dev/null
Binary files differ
diff --git a/tests/auto/threed/load_model/models/basic-cube.dae b/tests/auto/threed/load_model/models/basic-cube.dae
deleted file mode 100644
index 06167caf..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.dae
+++ /dev/null
@@ -1,192 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
- <asset>
- <contributor>
- <author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
- <authoring_tool>Blender v:249 - Illusoft Collada Exporter v:0.3.162</authoring_tool>
- <comments></comments>
- <copyright></copyright>
- <source_data>file:///Users/sez/depot/research/qt3d_assimp/tests/auto/threed/load_model/models/basic-cube.blend</source_data>
- </contributor>
- <created>2010-12-15T02:14:49.600213</created>
- <modified>2010-12-15T02:14:49.600247</modified>
- <unit meter="0.01" name="centimeter"/>
- <up_axis>Z_UP</up_axis>
- </asset>
- <library_effects>
- <effect id="Red-fx" name="Red-fx">
- <profile_COMMON>
- <technique sid="blender">
- <phong>
- <emission>
- <color>0.00000 0.00000 0.00000 1</color>
- </emission>
- <ambient>
- <color>0.45937 0.07860 0.07860 1</color>
- </ambient>
- <diffuse>
- <color>0.91873 0.15720 0.15720 1</color>
- </diffuse>
- <specular>
- <color>0.50000 0.50000 0.50000 1</color>
- </specular>
- <shininess>
- <float>12.5</float>
- </shininess>
- <reflective>
- <color>1.00000 1.00000 1.00000 1</color>
- </reflective>
- <reflectivity>
- <float>0.0</float>
- </reflectivity>
- <transparent>
- <color>1 1 1 1</color>
- </transparent>
- <transparency>
- <float>0.0</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- <effect id="SlateGray-fx" name="SlateGray-fx">
- <profile_COMMON>
- <technique sid="blender">
- <phong>
- <emission>
- <color>0.00000 0.00000 0.00000 1</color>
- </emission>
- <ambient>
- <color>0.18500 0.28000 0.30500 1</color>
- </ambient>
- <diffuse>
- <color>0.37000 0.56000 0.61000 1</color>
- </diffuse>
- <specular>
- <color>0.50000 0.50000 0.50000 1</color>
- </specular>
- <shininess>
- <float>12.5</float>
- </shininess>
- <reflective>
- <color>1.00000 1.00000 1.00000 1</color>
- </reflective>
- <reflectivity>
- <float>0.0</float>
- </reflectivity>
- <transparent>
- <color>1 1 1 1</color>
- </transparent>
- <transparency>
- <float>0.0</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- </library_effects>
- <library_materials>
- <material id="Red" name="Red">
- <instance_effect url="#Red-fx"/>
- </material>
- <material id="SlateGray" name="SlateGray">
- <instance_effect url="#SlateGray-fx"/>
- </material>
- </library_materials>
- <library_geometries>
- <geometry id="CubeObject-Geometry" name="CubeObject-Geometry">
- <mesh>
- <source id="CubeObject-Geometry-Position">
- <float_array count="24" id="CubeObject-Geometry-Position-array">1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000 1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000</float_array>
- <technique_common>
- <accessor count="8" source="#CubeObject-Geometry-Position-array" stride="3">
- <param type="float" name="X"></param>
- <param type="float" name="Y"></param>
- <param type="float" name="Z"></param>
- </accessor>
- </technique_common>
- </source>
- <source id="CubeObject-Geometry-Normals">
- <float_array count="18" id="CubeObject-Geometry-Normals-array">0.00000 0.00000 -1.00000 0.00000 -0.00000 1.00000 1.00000 -0.00000 0.00000 -0.00000 -1.00000 -0.00000 -1.00000 0.00000 -0.00000 0.00000 1.00000 0.00000</float_array>
- <technique_common>
- <accessor count="6" source="#CubeObject-Geometry-Normals-array" stride="3">
- <param type="float" name="X"></param>
- <param type="float" name="Y"></param>
- <param type="float" name="Z"></param>
- </accessor>
- </technique_common>
- </source>
- <vertices id="CubeObject-Geometry-Vertex">
- <input semantic="POSITION" source="#CubeObject-Geometry-Position"/>
- </vertices>
- <triangles count="10" material="Red">
- <input offset="0" semantic="VERTEX" source="#CubeObject-Geometry-Vertex"/>
- <input offset="1" semantic="NORMAL" source="#CubeObject-Geometry-Normals"/>
- <p>0 0 1 0 2 0 2 0 3 0 0 0 0 2 4 2 5 2 5 2 1 2 0 2 1 3 5 3 6 3 6 3 2 3 1 3 2 4 6 4 7 4 7 4 3 4 2 4 4 5 0 5 3 5 3 5 7 5 4 5</p>
- </triangles>
- <triangles count="2" material="SlateGray">
- <input offset="0" semantic="VERTEX" source="#CubeObject-Geometry-Vertex"/>
- <input offset="1" semantic="NORMAL" source="#CubeObject-Geometry-Normals"/>
- <p>4 1 7 1 6 1 6 1 5 1 4 1</p>
- </triangles>
- </mesh>
- </geometry>
- </library_geometries>
- <library_visual_scenes>
- <visual_scene id="Scene" name="Scene">
- <node layer="L1" id="CubeObject" name="CubeObject">
- <translate sid="translate">0.00000 0.00000 0.00000</translate>
- <rotate sid="rotateZ">0 0 1 0.00000</rotate>
- <rotate sid="rotateY">0 1 0 -0.00000</rotate>
- <rotate sid="rotateX">1 0 0 0.00000</rotate>
- <scale sid="scale">1.00000 1.00000 1.00000</scale>
- <instance_geometry url="#CubeObject-Geometry">
- <bind_material>
- <technique_common>
- <instance_material symbol="Red" target="#Red">
- <bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
- </instance_material>
- <instance_material symbol="SlateGray" target="#SlateGray">
- <bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
- </instance_material>
- </technique_common>
- </bind_material>
- </instance_geometry>
- </node>
- </visual_scene>
- </library_visual_scenes>
- <library_physics_materials>
- <physics_material id="CubeObject-PhysicsMaterial" name="CubeObject-PhysicsMaterial">
- <technique_common>
- <dynamic_friction>0.5</dynamic_friction>
- <restitution>0.0</restitution>
- <static_friction>0.5</static_friction>
- </technique_common>
- </physics_material>
- </library_physics_materials>
- <library_physics_models>
- <physics_model id="Scene-PhysicsModel" name="Scene-PhysicsModel">
- <rigid_body name="CubeObject-RigidBody" sid="CubeObject-RigidBody">
- <technique_common>
- <dynamic>false</dynamic>
- <mass>0</mass>
- <instance_physics_material url="#CubeObject-PhysicsMaterial"/>
- <shape>
- <instance_geometry url="#CubeObject-Geometry"/>
- </shape>
- </technique_common>
- </rigid_body>
- </physics_model>
- </library_physics_models>
- <library_physics_scenes>
- <physics_scene id="Scene-Physics" name="Scene-Physics">
- <instance_physics_model url="#Scene-PhysicsModel">
- <instance_rigid_body body="CubeObject-RigidBody" target="#CubeObject"/>
- </instance_physics_model>
- </physics_scene>
- </library_physics_scenes>
- <scene>
- <instance_physics_scene url="#Scene-Physics"/>
- <instance_visual_scene url="#Scene"/>
- </scene>
-</COLLADA>
diff --git a/tests/auto/threed/load_model/models/basic-cube.m3g b/tests/auto/threed/load_model/models/basic-cube.m3g
deleted file mode 100644
index 28962d8a..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.m3g
+++ /dev/null
Binary files differ
diff --git a/tests/auto/threed/load_model/models/basic-cube.mtl b/tests/auto/threed/load_model/models/basic-cube.mtl
deleted file mode 100644
index ce8c4b93..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.mtl
+++ /dev/null
@@ -1,22 +0,0 @@
-# Blender3D MTL File: basic-cube.blend
-# Material Count: 2
-newmtl SlateGray
-Ns 96.078431
-Ka 0.000000 0.000000 0.000000
-Kd 0.296000 0.448000 0.488000
-Ks 0.500000 0.500000 0.500000
-Ni 1.000000
-d 1.000000
-illum 2
-
-
-newmtl Red
-Ns 96.078431
-Ka 0.000000 0.000000 0.000000
-Kd 0.734986 0.125756 0.125756
-Ks 0.500000 0.500000 0.500000
-Ni 1.000000
-d 1.000000
-illum 2
-
-
diff --git a/tests/auto/threed/load_model/models/basic-cube.obj b/tests/auto/threed/load_model/models/basic-cube.obj
deleted file mode 100644
index 039b220e..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.obj
+++ /dev/null
@@ -1,27 +0,0 @@
-# Blender3D v249 OBJ File: basic-cube.blend
-# www.blender3d.org
-mtllib basic-cube.mtl
-o CubeObject_CubeMesh
-v 1.000000 -1.000000 -1.000000
-v 1.000000 -1.000000 1.000000
-v -1.000000 -1.000000 1.000000
-v -1.000000 -1.000000 -1.000000
-v 1.000000 1.000000 -1.000000
-v 0.999999 1.000000 1.000001
-v -1.000000 1.000000 1.000000
-v -1.000000 1.000000 -1.000000
-vn 0.000000 -1.000000 0.000000
-vn 1.000000 0.000000 0.000000
-vn 0.000000 0.000000 1.000000
-vn -1.000000 0.000000 0.000000
-vn 0.000000 0.000000 -1.000000
-vn 0.000000 1.000000 0.000000
-usemtl Red
-f 1//1 2//1 3//1 4//1
-f 1//2 5//2 6//2 2//2
-f 2//3 6//3 7//3 3//3
-f 3//4 7//4 8//4 4//4
-f 5//5 1//5 4//5 8//5
-usemtl SlateGray
-f 5//6 8//6 7//6 6//6
-
diff --git a/tests/auto/threed/load_model/models/basic-cube.ply b/tests/auto/threed/load_model/models/basic-cube.ply
deleted file mode 100644
index ddb5be70..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.ply
+++ /dev/null
@@ -1,43 +0,0 @@
-ply
-format ascii 1.0
-comment Created by Blender3D 249 - www.blender.org, source file: basic-cube.blend
-element vertex 24
-property float x
-property float y
-property float z
-property float nx
-property float ny
-property float nz
-element face 6
-property list uchar uint vertex_indices
-end_header
-1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000
-1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000
--1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000
--1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000
-1.000000 0.999999 1.000000 0.000000 -0.000000 1.000000
--1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000
--1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000
-0.999999 -1.000001 1.000000 0.000000 -0.000000 1.000000
-1.000000 1.000000 -1.000000 1.000000 -0.000000 0.000000
-1.000000 0.999999 1.000000 1.000000 -0.000000 0.000000
-0.999999 -1.000001 1.000000 1.000000 -0.000000 0.000000
-1.000000 -1.000000 -1.000000 1.000000 -0.000000 0.000000
-1.000000 -1.000000 -1.000000 -0.000000 -1.000000 -0.000000
-0.999999 -1.000001 1.000000 -0.000000 -1.000000 -0.000000
--1.000000 -1.000000 1.000000 -0.000000 -1.000000 -0.000000
--1.000000 -1.000000 -1.000000 -0.000000 -1.000000 -0.000000
--1.000000 -1.000000 -1.000000 -1.000000 0.000000 -0.000000
--1.000000 -1.000000 1.000000 -1.000000 0.000000 -0.000000
--1.000000 1.000000 1.000000 -1.000000 0.000000 -0.000000
--1.000000 1.000000 -1.000000 -1.000000 0.000000 -0.000000
-1.000000 0.999999 1.000000 0.000000 1.000000 0.000000
-1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000
--1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000
--1.000000 1.000000 1.000000 0.000000 1.000000 0.000000
-4 0 1 2 3
-4 4 5 6 7
-4 8 9 10 11
-4 12 13 14 15
-4 16 17 18 19
-4 20 21 22 23
diff --git a/tests/auto/threed/load_model/models/basic-cube.x3d b/tests/auto/threed/load_model/models/basic-cube.x3d
deleted file mode 100644
index 0c52894d..00000000
--- a/tests/auto/threed/load_model/models/basic-cube.x3d
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
-<X3D version="3.0" profile="Immersive" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">
-<head>
- <meta name="filename" content="basic-cube.x3d" />
- <meta name="generator" content="Blender 249" />
- <meta name="translator" content="X3D exporter v1.55 (2006/01/17)" />
-</head>
-<Scene>
-<NavigationInfo headlight="FALSE" visibilityLimit="0.0" type='"EXAMINE","ANY"' avatarSize="0.25, 1.75, 0.75" />
-<Background groundColor="0.057 0.221 0.4" skyColor="0.057 0.221 0.4" />
-
-<Collision enabled="false">
- <Transform DEF="CubeObject" translation="0.000000 0.000000 0.000000" scale="1.000000 1.000000 1.000000" rotation="-1.000000 0.000000 0.000000 1.570796">
- <Shape>
- <Appearance>
- <Material DEF="MA_Red" diffuseColor="0.919 0.157 0.157" specularColor="0.401 0.401 0.401" emissiveColor="0.0 0.0 0.0"
- ambientIntensity="0.167" shininess="0.098" transparency="0.0" />
- </Appearance>
- <IndexedFaceSet solid="true" coordIndex="0 1 2 -1, 0 2 3 -1, 4 7 6 -1, 4 6 5 -1, 0 4 5 -1, 0 5 1 -1, 1 5 6 -1, 1 6 2 -1, 2 6 7 -1, 2 7 3 -1, 4 0 3 -1, 4 3 7 -1, ">
- <Coordinate DEF="coord_CubeObject"
- point="1.000000 1.000000 -1.000000, 1.000000 -1.000000 -1.000000, -1.000000 -1.000000 -1.000000, -1.000000 1.000000 -1.000000, 1.000000 0.999999 1.000000, 0.999999 -1.000001 1.000000, -1.000000 -1.000000 1.000000, -1.000000 1.000000 1.000000, " />
- </IndexedFaceSet>
- </Shape>
-</Transform>
-</Collision>
-
-
-</Scene>
-</X3D>
diff --git a/tests/auto/threed/load_model/models/cube.dae b/tests/auto/threed/load_model/models/cube.dae
deleted file mode 100644
index cda4d16c..00000000
--- a/tests/auto/threed/load_model/models/cube.dae
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
- <asset>
- <contributor>
- <author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
- <authoring_tool>Blender v:249 - Illusoft Collada Exporter v:0.3.162</authoring_tool>
- <comments></comments>
- <copyright></copyright>
- <source_data>file://</source_data>
- </contributor>
- <created>2010-12-15T02:07:15.785711</created>
- <modified>2010-12-15T02:07:15.787585</modified>
- <unit meter="0.01" name="centimeter"/>
- <up_axis>Z_UP</up_axis>
- </asset>
- <library_effects>
- <effect id="Material-fx" name="Material-fx">
- <profile_COMMON>
- <technique sid="blender">
- <phong>
- <emission>
- <color>0.00000 0.00000 0.00000 1</color>
- </emission>
- <ambient>
- <color>0.40000 0.40000 0.40000 1</color>
- </ambient>
- <diffuse>
- <color>0.80000 0.80000 0.80000 1</color>
- </diffuse>
- <specular>
- <color>0.50000 0.50000 0.50000 1</color>
- </specular>
- <shininess>
- <float>12.5</float>
- </shininess>
- <reflective>
- <color>1.00000 1.00000 1.00000 1</color>
- </reflective>
- <reflectivity>
- <float>0.0</float>
- </reflectivity>
- <transparent>
- <color>1 1 1 1</color>
- </transparent>
- <transparency>
- <float>0.0</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- </library_effects>
- <library_materials>
- <material id="Material" name="Material">
- <instance_effect url="#Material-fx"/>
- </material>
- </library_materials>
- <library_geometries>
- <geometry id="Cube_001" name="Cube_001">
- <mesh>
- <source id="Cube_001-Position">
- <float_array count="24" id="Cube_001-Position-array">1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000 1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000</float_array>
- <technique_common>
- <accessor count="8" source="#Cube_001-Position-array" stride="3">
- <param type="float" name="X"></param>
- <param type="float" name="Y"></param>
- <param type="float" name="Z"></param>
- </accessor>
- </technique_common>
- </source>
- <source id="Cube_001-Normals">
- <float_array count="18" id="Cube_001-Normals-array">0.00000 0.00000 -1.00000 0.00000 -0.00000 1.00000 1.00000 -0.00000 0.00000 -0.00000 -1.00000 -0.00000 -1.00000 0.00000 -0.00000 0.00000 1.00000 0.00000</float_array>
- <technique_common>
- <accessor count="6" source="#Cube_001-Normals-array" stride="3">
- <param type="float" name="X"></param>
- <param type="float" name="Y"></param>
- <param type="float" name="Z"></param>
- </accessor>
- </technique_common>
- </source>
- <vertices id="Cube_001-Vertex">
- <input semantic="POSITION" source="#Cube_001-Position"/>
- </vertices>
- <triangles count="12" material="Material">
- <input offset="0" semantic="VERTEX" source="#Cube_001-Vertex"/>
- <input offset="1" semantic="NORMAL" source="#Cube_001-Normals"/>
- <p>0 0 1 0 2 0 2 0 3 0 0 0 4 1 7 1 6 1 6 1 5 1 4 1 0 2 4 2 5 2 5 2 1 2 0 2 1 3 5 3 6 3 6 3 2 3 1 3 2 4 6 4 7 4 7 4 3 4 2 4 4 5 0 5 3 5 3 5 7 5 4 5</p>
- </triangles>
- </mesh>
- </geometry>
- </library_geometries>
- <library_visual_scenes>
- <visual_scene id="Scene" name="Scene">
- <node layer="L1" id="Cube" name="Cube">
- <translate sid="translate">0.00000 0.00000 0.00000</translate>
- <rotate sid="rotateZ">0 0 1 0.00000</rotate>
- <rotate sid="rotateY">0 1 0 -0.00000</rotate>
- <rotate sid="rotateX">1 0 0 0.00000</rotate>
- <scale sid="scale">1.00000 1.00000 1.00000</scale>
- <instance_geometry url="#Cube_001">
- <bind_material>
- <technique_common>
- <instance_material symbol="Material" target="#Material">
- <bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
- </instance_material>
- </technique_common>
- </bind_material>
- </instance_geometry>
- </node>
- </visual_scene>
- </library_visual_scenes>
- <library_physics_materials>
- <physics_material id="Cube-PhysicsMaterial" name="Cube-PhysicsMaterial">
- <technique_common>
- <dynamic_friction>0.5</dynamic_friction>
- <restitution>0.0</restitution>
- <static_friction>0.5</static_friction>
- </technique_common>
- </physics_material>
- </library_physics_materials>
- <library_physics_models>
- <physics_model id="Scene-PhysicsModel" name="Scene-PhysicsModel">
- <rigid_body name="Cube-RigidBody" sid="Cube-RigidBody">
- <technique_common>
- <dynamic>false</dynamic>
- <mass>0</mass>
- <instance_physics_material url="#Cube-PhysicsMaterial"/>
- <shape>
- <instance_geometry url="#Cube_001"/>
- </shape>
- </technique_common>
- </rigid_body>
- </physics_model>
- </library_physics_models>
- <library_physics_scenes>
- <physics_scene id="Scene-Physics" name="Scene-Physics">
- <instance_physics_model url="#Scene-PhysicsModel">
- <instance_rigid_body body="Cube-RigidBody" target="#Cube"/>
- </instance_physics_model>
- </physics_scene>
- </library_physics_scenes>
- <scene>
- <instance_physics_scene url="#Scene-Physics"/>
- <instance_visual_scene url="#Scene"/>
- </scene>
-</COLLADA>
diff --git a/tests/auto/threed/load_model/models/teacup.bez b/tests/auto/threed/load_model/models/teacup.bez
deleted file mode 100644
index f4dde3ef..00000000
--- a/tests/auto/threed/load_model/models/teacup.bez
+++ /dev/null
@@ -1,280 +0,0 @@
-26
-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
-4,17,18,19,8,20,21,22,12,23,24,25,16,26,27,28
-19,29,30,31,22,32,33,34,25,35,36,37,28,38,39,40
-31,41,42,1,34,43,44,5,37,45,46,9,40,47,48,13
-13,14,15,16,49,50,51,52,53,54,55,56,57,58,59,60
-16,26,27,28,52,61,62,63,56,64,65,66,60,67,68,69
-28,38,39,40,63,70,71,72,66,73,74,75,69,76,77,78
-40,47,48,13,72,79,80,49,75,81,82,53,78,83,84,57
-193,194,195,196,197,198,199,200,201,202,203,204,1,2,3,4
-196,205,206,207,200,208,209,210,204,211,212,213,4,17,18,19
-207,214,215,216,210,217,218,219,213,220,221,222,19,29,30,31
-216,223,224,193,219,225,226,197,222,227,228,201,31,41,42,1
-229,230,231,28,232,233,234,235,236,237,238,239,240,241,242,243
-28,244,245,229,235,246,247,232,239,248,249,236,243,250,251,240
-57,58,59,60,85,86,87,88,89,90,91,92,93,94,95,96
-60,67,68,69,88,97,98,99,92,100,101,102,96,103,104,105
-69,76,77,78,99,106,107,108,102,109,110,111,105,112,113,114
-78,83,84,57,108,115,116,85,111,117,118,89,114,119,120,93
-93,94,95,96,121,122,123,124,125,126,127,128,129,130,131,132
-96,103,104,105,124,133,134,135,128,136,137,138,132,139,140,141
-105,112,113,114,135,142,143,144,138,145,146,147,141,148,149,150
-114,119,120,93,144,151,152,121,147,153,154,125,150,155,156,129
-129,130,131,132,157,158,159,160,161,162,163,164,165,166,167,168
-132,139,140,141,160,169,170,171,164,172,173,174,168,175,176,177
-141,148,149,150,171,178,179,180,174,181,182,183,177,184,185,186
-150,155,156,129,180,187,188,157,183,189,190,161,186,191,192,165
-251
-0.409091,0.772727,0.0
-0.409091,0.772727,-0.229091
-0.229091,0.772727,-0.409091
-0.0,0.772727,-0.409091
-0.409091,0.886364,0.0
-0.409091,0.886364,-0.229091
-0.229091,0.886364,-0.409091
-0.0,0.886364,-0.409091
-0.454545,0.886364,0.0
-0.454545,0.886364,-0.254545
-0.254545,0.886364,-0.454545
-0.0,0.886364,-0.454545
-0.454545,0.772727,0.0
-0.454545,0.772727,-0.254545
-0.254545,0.772727,-0.454545
-0.0,0.772727,-0.454545
--0.229091,0.772727,-0.409091
--0.409091,0.772727,-0.229091
--0.409091,0.772727,0.0
--0.229091,0.886364,-0.409091
--0.409091,0.886364,-0.229091
--0.409091,0.886364,0.0
--0.254545,0.886364,-0.454545
--0.454545,0.886364,-0.254545
--0.454545,0.886364,0.0
--0.254545,0.772727,-0.454545
--0.454545,0.772727,-0.254545
--0.454545,0.772727,0.0
--0.409091,0.772727,0.229091
--0.229091,0.772727,0.409091
-0.0,0.772727,0.409091
--0.409091,0.886364,0.229091
--0.229091,0.886364,0.409091
-0.0,0.886364,0.409091
--0.454545,0.886364,0.254545
--0.254545,0.886364,0.454545
-0.0,0.886364,0.454545
--0.454545,0.772727,0.254545
--0.254545,0.772727,0.454545
-0.0,0.772727,0.454545
-0.229091,0.772727,0.409091
-0.409091,0.772727,0.229091
-0.229091,0.886364,0.409091
-0.409091,0.886364,0.229091
-0.254545,0.886364,0.454545
-0.454545,0.886364,0.254545
-0.254545,0.772727,0.454545
-0.454545,0.772727,0.254545
-0.454545,0.545455,0.0
-0.454545,0.545455,-0.254545
-0.254545,0.545455,-0.454545
-0.0,0.545455,-0.454545
-0.454545,0.272727,0.0
-0.454545,0.272727,-0.254545
-0.254545,0.272727,-0.454545
-0.0,0.272727,-0.454545
-0.318182,0.0454545,0.0
-0.318182,0.0454545,-0.178182
-0.178182,0.0454545,-0.318182
-0.0,0.0454545,-0.318182
--0.254545,0.545455,-0.454545
--0.454545,0.545455,-0.254545
--0.454545,0.545455,0.0
--0.254545,0.272727,-0.454545
--0.454545,0.272727,-0.254545
--0.454545,0.272727,0.0
--0.178182,0.0454545,-0.318182
--0.318182,0.0454545,-0.178182
--0.318182,0.0454545,0.0
--0.454545,0.545455,0.254545
--0.254545,0.545455,0.454545
-0.0,0.545455,0.454545
--0.454545,0.272727,0.254545
--0.254545,0.272727,0.454545
-0.0,0.272727,0.454545
--0.318182,0.0454545,0.178182
--0.178182,0.0454545,0.318182
-0.0,0.0454545,0.318182
-0.254545,0.545455,0.454545
-0.454545,0.545455,0.254545
-0.254545,0.272727,0.454545
-0.454545,0.272727,0.254545
-0.178182,0.0454545,0.318182
-0.318182,0.0454545,0.178182
-0.545455,0.0454545,0.0
-0.545455,0.0454545,-0.305455
-0.305455,0.0454545,-0.545455
-0.0,0.0454545,-0.545455
-0.727273,0.136364,0.0
-0.727273,0.136364,-0.407273
-0.407273,0.136364,-0.727273
-0.0,0.136364,-0.727273
-0.909091,0.136364,0.0
-0.909091,0.136364,-0.509091
-0.509091,0.136364,-0.909091
-0.0,0.136364,-0.909091
--0.305455,0.0454545,-0.545455
--0.545455,0.0454545,-0.305455
--0.545455,0.0454545,0.0
--0.407273,0.136364,-0.727273
--0.727273,0.136364,-0.407273
--0.727273,0.136364,0.0
--0.509091,0.136364,-0.909091
--0.909091,0.136364,-0.509091
--0.909091,0.136364,0.0
--0.545455,0.0454545,0.305455
--0.305455,0.0454545,0.545455
-0.0,0.0454545,0.545455
--0.727273,0.136364,0.407273
--0.407273,0.136364,0.727273
-0.0,0.136364,0.727273
--0.909091,0.136364,0.509091
--0.509091,0.136364,0.909091
-0.0,0.136364,0.909091
-0.305455,0.0454545,0.545455
-0.545455,0.0454545,0.305455
-0.407273,0.136364,0.727273
-0.727273,0.136364,0.407273
-0.509091,0.136364,0.909091
-0.909091,0.136364,0.509091
-1.0,0.136364,0.0
-1.0,0.136364,-0.56
-0.56,0.136364,-1.0
-0.0,0.136364,-1.0
-1.0,0.0909091,0.0
-1.0,0.0909091,-0.56
-0.56,0.0909091,-1.0
-0.0,0.0909091,-1.0
-0.909091,0.0909091,0.0
-0.909091,0.0909091,-0.509091
-0.509091,0.0909091,-0.909091
-0.0,0.0909091,-0.909091
--0.56,0.136364,-1.0
--1.0,0.136364,-0.56
--1.0,0.136364,0.0
--0.56,0.0909091,-1.0
--1.0,0.0909091,-0.56
--1.0,0.0909091,0.0
--0.509091,0.0909091,-0.909091
--0.909091,0.0909091,-0.509091
--0.909091,0.0909091,0.0
--1.0,0.136364,0.56
--0.56,0.136364,1.0
-0.0,0.136364,1.0
--1.0,0.0909091,0.56
--0.56,0.0909091,1.0
-0.0,0.0909091,1.0
--0.909091,0.0909091,0.509091
--0.509091,0.0909091,0.909091
-0.0,0.0909091,0.909091
-0.56,0.136364,1.0
-1.0,0.136364,0.56
-0.56,0.0909091,1.0
-1.0,0.0909091,0.56
-0.509091,0.0909091,0.909091
-0.909091,0.0909091,0.509091
-0.727273,0.0909091,0.0
-0.727273,0.0909091,-0.407273
-0.407273,0.0909091,-0.727273
-0.0,0.0909091,-0.727273
-0.545455,0.0,0.0
-0.545455,0.0,-0.305455
-0.305455,0.0,-0.545455
-0.0,0.0,-0.545455
-0.318182,0.0,0.0
-0.318182,0.0,-0.178182
-0.178182,0.0,-0.318182
-0.0,0.0,-0.318182
--0.407273,0.0909091,-0.727273
--0.727273,0.0909091,-0.407273
--0.727273,0.0909091,0.0
--0.305455,0.0,-0.545455
--0.545455,0.0,-0.305455
--0.545455,0.0,0.0
--0.178182,0.0,-0.318182
--0.318182,0.0,-0.178182
--0.318182,0.0,0.0
--0.727273,0.0909091,0.407273
--0.407273,0.0909091,0.727273
-0.0,0.0909091,0.727273
--0.545455,0.0,0.305455
--0.305455,0.0,0.545455
-0.0,0.0,0.545455
--0.318182,0.0,0.178182
--0.178182,0.0,0.318182
-0.0,0.0,0.318182
-0.407273,0.0909091,0.727273
-0.727273,0.0909091,0.407273
-0.305455,0.0,0.545455
-0.545455,0.0,0.305455
-0.178182,0.0,0.318182
-0.318182,0.0,0.178182
-0.272727,0.0454545,0.0
-0.272727,0.0454545,-0.152727
-0.152727,0.0454545,-0.272727
-0.0,0.0454545,-0.272727
-0.409091,0.272727,0.0
-0.409091,0.272727,-0.229091
-0.229091,0.272727,-0.409091
-0.0,0.272727,-0.409091
-0.409091,0.545455,0.0
-0.409091,0.545455,-0.229091
-0.229091,0.545455,-0.409091
-0.0,0.545455,-0.409091
--0.152727,0.0454545,-0.272727
--0.272727,0.0454545,-0.152727
--0.272727,0.0454545,0.0
--0.229091,0.272727,-0.409091
--0.409091,0.272727,-0.229091
--0.409091,0.272727,0.0
--0.229091,0.545455,-0.409091
--0.409091,0.545455,-0.229091
--0.409091,0.545455,0.0
--0.272727,0.0454545,0.152727
--0.152727,0.0454545,0.272727
-0.0,0.0454545,0.272727
--0.409091,0.272727,0.229091
--0.229091,0.272727,0.409091
-0.0,0.272727,0.409091
--0.409091,0.545455,0.229091
--0.229091,0.545455,0.409091
-0.0,0.545455,0.409091
-0.152727,0.0454545,0.272727
-0.272727,0.0454545,0.152727
-0.229091,0.272727,0.409091
-0.409091,0.272727,0.229091
-0.229091,0.545455,0.409091
-0.409091,0.545455,0.229091
--0.454545,0.704545,0.0
--0.454545,0.704545,-0.0454545
--0.454545,0.772727,-0.0454545
--0.772727,0.863636,0.0
--0.772727,0.863636,-0.0454545
--0.818182,0.954545,-0.0454545
--0.818182,0.954545,0.0
--0.772727,0.522727,0.0
--0.772727,0.522727,-0.0454545
--0.909091,0.477273,-0.0454545
--0.909091,0.477273,0.0
--0.409091,0.363636,0.0
--0.409091,0.363636,-0.0454545
--0.409091,0.295455,-0.0454545
--0.409091,0.295455,0.0
--0.454545,0.772727,0.0454545
--0.454545,0.704545,0.0454545
--0.818182,0.954545,0.0454545
--0.772727,0.863636,0.0454545
--0.909091,0.477273,0.0454545
--0.772727,0.522727,0.0454545
--0.409091,0.295455,0.0454545
--0.409091,0.363636,0.0454545
-# reverse-patches
diff --git a/tests/auto/threed/load_model/models/wave.obj b/tests/auto/threed/load_model/models/wave.obj
deleted file mode 100644
index d47fba48..00000000
--- a/tests/auto/threed/load_model/models/wave.obj
+++ /dev/null
@@ -1,476 +0,0 @@
-o Wave_Obj
-v -180 -180 20.21
-v -180 -120 39.571
-v -180 -60 103.881
-v -180 0 150.836
-v -180 60 104.229
-v -180 120 39.241
-v -180 180 20.21
-v -170 -180 41.143
-v -170 -120 71.763
-v -170 -60 155.217
-v -170 0 201.577
-v -170 60 142.873
-v -170 120 64.235
-v -170 180 41.143
-v -160 -180 69.49
-v -160 -120 113.906
-v -160 -60 212.144
-v -160 0 253.998
-v -160 60 183.949
-v -160 120 94.971
-v -160 180 69.49
-v -150 -180 103.5
-v -150 -120 161.47
-v -150 -60 269.407
-v -150 0 304.377
-v -150 60 223.999
-v -150 120 128.686
-v -150 180 103.5
-v -140 -180 138.975
-v -140 -120 208.317
-v -140 -60 322.442
-v -140 0 349.416
-v -140 60 260.097
-v -140 120 161.508
-v -140 180 138.975
-v -130 -180 171.412
-v -130 -120 249.8
-v -130 -60 367.819
-v -130 0 386.836
-v -130 60 290.235
-v -130 120 190.26
-v -130 180 171.412
-v -120 -180 198.071
-v -120 -120 283.402
-v -120 -60 403.825
-v -120 0 415.796
-v -120 60 313.627
-v -120 120 213.295
-v -120 180 198.071
-v -110 -180 218.155
-v -110 -120 308.549
-v -110 -60 430.441
-v -110 0 436.769
-v -110 60 330.597
-v -110 120 230.372
-v -110 180 218.155
-v -100 -180 232.096
-v -100 -120 325.951
-v -100 -60 448.727
-v -100 0 450.948
-v -100 60 342.085
-v -100 120 242.103
-v -100 180 232.096
-v -90 -180 240.799
-v -90 -120 336.8
-v -90 -60 460.077
-v -90 0 459.653
-v -90 60 349.144
-v -90 120 249.379
-v -90 180 240.799
-v -80 -180 245.162
-v -80 -120 342.236
-v -80 -60 465.751
-v -80 0 463.975
-v -80 60 352.652
-v -80 120 253.013
-v -80 180 245.162
-v -70 -180 245.876
-v -70 -120 343.125
-v -70 -60 466.678
-v -70 0 464.679
-v -70 60 353.224
-v -70 120 253.607
-v -70 180 245.876
-v -60 -180 243.379
-v -60 -120 340.015
-v -60 -60 463.434
-v -60 0 462.212
-v -60 60 351.221
-v -60 120 251.529
-v -60 180 243.379
-v -50 -180 237.873
-v -50 -120 333.154
-v -50 -60 456.266
-v -50 0 456.739
-v -50 60 346.781
-v -50 120 246.937
-v -50 180 237.873
-v -40 -180 229.336
-v -40 -120 322.509
-v -40 -60 445.118
-v -40 0 448.165
-v -40 60 339.829
-v -40 120 239.788
-v -40 180 229.336
-v -30 -180 217.539
-v -30 -120 307.779
-v -30 -60 429.63
-v -30 0 436.135
-v -30 60 330.084
-v -30 120 229.851
-v -30 180 217.539
-v -20 -180 202.042
-v -20 -120 288.383
-v -20 -60 409.118
-v -20 0 419.997
-v -20 60 317.024
-v -20 120 216.689
-v -20 180 202.042
-v -10 -180 182.22
-v -10 -120 263.461
-v -10 -60 382.526
-v -10 0 398.745
-v -10 60 299.848
-v -10 120 199.654
-v -10 180 182.22
-v 0 -180 157.356
-v 0 -120 231.929
-v 0 -60 348.414
-v 0 0 370.958
-v 0 60 277.434
-v 0 120 177.914
-v 0 180 157.356
-v 10 -180 127.018
-v 10 -120 192.755
-v 10 -60 305.077
-v 10 0 334.827
-v 10 60 248.38
-v 10 120 150.643
-v 10 180 127.018
-v 20 -180 92.098
-v 20 -120 145.878
-v 20 -60 251.138
-v 20 0 288.517
-v 20 60 211.347
-v 20 120 117.688
-v 20 180 92.098
-v 30 -180 56.374
-v 30 -120 94.668
-v 30 -60 187.198
-v 30 0 231.371
-v 30 60 166.122
-v 30 120 81.11
-v 30 180 56.374
-v 40 -180 25.98
-v 40 -120 48.522
-v 40 -60 119.078
-v 40 0 166.372
-v 40 60 115.898
-v 40 120 46.398
-v 40 180 25.98
-v 50 -180 5.981
-v 50 -120 16.643
-v 50 -60 60.852
-v 50 0 102.95
-v 50 60 69.36
-v 50 120 19.719
-v 50 180 5.981
-v 60 -180 0.255
-v 60 -120 1.383
-v 60 -60 23.928
-v 60 0 54.669
-v 60 60 35.477
-v 60 120 4.089
-v 60 180 0.255
-v 70 -180 18.321
-v 70 -120 3.316
-v 70 -60 5.835
-v 70 0 25.99
-v 70 60 15.427
-v 70 120 0.156
-v 70 180 18.321
-v 80 -180 59.32
-v 80 -120 28.502
-v 80 -60 0.178
-v 80 0 11.554
-v 80 60 5.561
-v 80 120 8.051
-v 80 180 59.32
-v 90 -180 57.91
-v 90 -120 68.006
-v 90 -60 0.905
-v 90 0 5.415
-v 90 60 1.77
-v 90 120 31.774
-v 90 180 57.91
-v 100 -180 57.335
-v 100 -120 67.375
-v 100 -60 2.408
-v 100 0 3.583
-v 100 60 0.819
-v 100 120 49.323
-v 100 180 57.335
-v 110 -180 57.545
-v 110 -120 67.606
-v 110 -60 1.766
-v 110 0 4.209
-v 110 60 1.126
-v 110 120 49.47
-v 110 180 57.545
-v 120 -180 58.399
-v 120 -120 68.542
-v 120 -60 0.211
-v 120 0 7.273
-v 120 60 2.852
-v 120 120 18.844
-v 120 180 58.399
-v 130 -180 59.722
-v 130 -120 19.94
-v 130 -60 0.647
-v 130 0 13.771
-v 130 60 7.03
-v 130 120 5.33
-v 130 180 59.722
-v 140 -180 20.309
-v 140 -120 3.839
-v 140 -60 5.366
-v 140 0 25.099
-v 140 60 14.806
-v 140 120 0.252
-v 140 180 20.309
-v 150 -180 2.643
-v 150 -120 0.03
-v 150 -60 16.035
-v 150 0 42.966
-v 150 60 27.3
-v 150 120 1.447
-v 150 180 2.643
-v 160 -180 0.334
-v 160 -120 4.859
-v 160 -60 34.47
-v 160 0 69.362
-v 160 60 45.731
-v 160 120 8.272
-v 160 180 0.334
-v 170 -180 6.626
-v 170 -120 17.756
-v 170 -60 63.11
-v 170 0 105.651
-v 170 60 71.284
-v 170 120 20.723
-v 170 180 6.626
-v 180 -180 20.21
-v 180 -120 39.571
-v 180 -60 103.881
-v 180 0 150.836
-v 180 60 104.229
-v 180 120 39.241
-v 180 180 20.21
-f 1/1 2/2 9/3 8/4
-f 2/1 3/2 10/3 9/4
-f 3/1 4/2 11/3 10/4
-f 4/1 5/2 12/3 11/4
-f 5/1 6/2 13/3 12/4
-f 6/1 7/2 14/3 13/4
-f 8/1 9/2 16/3 15/4
-f 9/1 10/2 17/3 16/4
-f 10/1 11/2 18/3 17/4
-f 11/1 12/2 19/3 18/4
-f 12/1 13/2 20/3 19/4
-f 13/1 14/2 21/3 20/4
-f 15/1 16/2 23/3 22/4
-f 16/1 17/2 24/3 23/4
-f 17/1 18/2 25/3 24/4
-f 18/1 19/2 26/3 25/4
-f 19/1 20/2 27/3 26/4
-f 20/1 21/2 28/3 27/4
-f 22/1 23/2 30/3 29/4
-f 23/1 24/2 31/3 30/4
-f 24/1 25/2 32/3 31/4
-f 25/1 26/2 33/3 32/4
-f 26/1 27/2 34/3 33/4
-f 27/1 28/2 35/3 34/4
-f 29/1 30/2 37/3 36/4
-f 30/1 31/2 38/3 37/4
-f 31/1 32/2 39/3 38/4
-f 32/1 33/2 40/3 39/4
-f 33/1 34/2 41/3 40/4
-f 34/1 35/2 42/3 41/4
-f 36/1 37/2 44/3 43/4
-f 37/1 38/2 45/3 44/4
-f 38/1 39/2 46/3 45/4
-f 39/1 40/2 47/3 46/4
-f 40/1 41/2 48/3 47/4
-f 41/1 42/2 49/3 48/4
-f 43/1 44/2 51/3 50/4
-f 44/1 45/2 52/3 51/4
-f 45/1 46/2 53/3 52/4
-f 46/1 47/2 54/3 53/4
-f 47/1 48/2 55/3 54/4
-f 48/1 49/2 56/3 55/4
-f 50/1 51/2 58/3 57/4
-f 51/1 52/2 59/3 58/4
-f 52/1 53/2 60/3 59/4
-f 53/1 54/2 61/3 60/4
-f 54/1 55/2 62/3 61/4
-f 55/1 56/2 63/3 62/4
-f 57/1 58/2 65/3 64/4
-f 58/1 59/2 66/3 65/4
-f 59/1 60/2 67/3 66/4
-f 60/1 61/2 68/3 67/4
-f 61/1 62/2 69/3 68/4
-f 62/1 63/2 70/3 69/4
-f 64/1 65/2 72/3 71/4
-f 65/1 66/2 73/3 72/4
-f 66/1 67/2 74/3 73/4
-f 67/1 68/2 75/3 74/4
-f 68/1 69/2 76/3 75/4
-f 69/1 70/2 77/3 76/4
-f 71/1 72/2 79/3 78/4
-f 72/1 73/2 80/3 79/4
-f 73/1 74/2 81/3 80/4
-f 74/1 75/2 82/3 81/4
-f 75/1 76/2 83/3 82/4
-f 76/1 77/2 84/3 83/4
-f 78/1 79/2 86/3 85/4
-f 79/1 80/2 87/3 86/4
-f 80/1 81/2 88/3 87/4
-f 81/1 82/2 89/3 88/4
-f 82/1 83/2 90/3 89/4
-f 83/1 84/2 91/3 90/4
-f 85/1 86/2 93/3 92/4
-f 86/1 87/2 94/3 93/4
-f 87/1 88/2 95/3 94/4
-f 88/1 89/2 96/3 95/4
-f 89/1 90/2 97/3 96/4
-f 90/1 91/2 98/3 97/4
-f 92/1 93/2 100/3 99/4
-f 93/1 94/2 101/3 100/4
-f 94/1 95/2 102/3 101/4
-f 95/1 96/2 103/3 102/4
-f 96/1 97/2 104/3 103/4
-f 97/1 98/2 105/3 104/4
-f 99/1 100/2 107/3 106/4
-f 100/1 101/2 108/3 107/4
-f 101/1 102/2 109/3 108/4
-f 102/1 103/2 110/3 109/4
-f 103/1 104/2 111/3 110/4
-f 104/1 105/2 112/3 111/4
-f 106/1 107/2 114/3 113/4
-f 107/1 108/2 115/3 114/4
-f 108/1 109/2 116/3 115/4
-f 109/1 110/2 117/3 116/4
-f 110/1 111/2 118/3 117/4
-f 111/1 112/2 119/3 118/4
-f 113/1 114/2 121/3 120/4
-f 114/1 115/2 122/3 121/4
-f 115/1 116/2 123/3 122/4
-f 116/1 117/2 124/3 123/4
-f 117/1 118/2 125/3 124/4
-f 118/1 119/2 126/3 125/4
-f 120/1 121/2 128/3 127/4
-f 121/1 122/2 129/3 128/4
-f 122/1 123/2 130/3 129/4
-f 123/1 124/2 131/3 130/4
-f 124/1 125/2 132/3 131/4
-f 125/1 126/2 133/3 132/4
-f 127/1 128/2 135/3 134/4
-f 128/1 129/2 136/3 135/4
-f 129/1 130/2 137/3 136/4
-f 130/1 131/2 138/3 137/4
-f 131/1 132/2 139/3 138/4
-f 132/1 133/2 140/3 139/4
-f 134/1 135/2 142/3 141/4
-f 135/1 136/2 143/3 142/4
-f 136/1 137/2 144/3 143/4
-f 137/1 138/2 145/3 144/4
-f 138/1 139/2 146/3 145/4
-f 139/1 140/2 147/3 146/4
-f 141/1 142/2 149/3 148/4
-f 142/1 143/2 150/3 149/4
-f 143/1 144/2 151/3 150/4
-f 144/1 145/2 152/3 151/4
-f 145/1 146/2 153/3 152/4
-f 146/1 147/2 154/3 153/4
-f 148/1 149/2 156/3 155/4
-f 149/1 150/2 157/3 156/4
-f 150/1 151/2 158/3 157/4
-f 151/1 152/2 159/3 158/4
-f 152/1 153/2 160/3 159/4
-f 153/1 154/2 161/3 160/4
-f 155/1 156/2 163/3 162/4
-f 156/1 157/2 164/3 163/4
-f 157/1 158/2 165/3 164/4
-f 158/1 159/2 166/3 165/4
-f 159/1 160/2 167/3 166/4
-f 160/1 161/2 168/3 167/4
-f 162/1 163/2 170/3 169/4
-f 163/1 164/2 171/3 170/4
-f 164/1 165/2 172/3 171/4
-f 165/1 166/2 173/3 172/4
-f 166/1 167/2 174/3 173/4
-f 167/1 168/2 175/3 174/4
-f 169/1 170/2 177/3 176/4
-f 170/1 171/2 178/3 177/4
-f 171/1 172/2 179/3 178/4
-f 172/1 173/2 180/3 179/4
-f 173/1 174/2 181/3 180/4
-f 174/1 175/2 182/3 181/4
-f 176/1 177/2 184/3 183/4
-f 177/1 178/2 185/3 184/4
-f 178/1 179/2 186/3 185/4
-f 179/1 180/2 187/3 186/4
-f 180/1 181/2 188/3 187/4
-f 181/1 182/2 189/3 188/4
-f 183/1 184/2 191/3 190/4
-f 184/1 185/2 192/3 191/4
-f 185/1 186/2 193/3 192/4
-f 186/1 187/2 194/3 193/4
-f 187/1 188/2 195/3 194/4
-f 188/1 189/2 196/3 195/4
-f 190/1 191/2 198/3 197/4
-f 191/1 192/2 199/3 198/4
-f 192/1 193/2 200/3 199/4
-f 193/1 194/2 201/3 200/4
-f 194/1 195/2 202/3 201/4
-f 195/1 196/2 203/3 202/4
-f 197/1 198/2 205/3 204/4
-f 198/1 199/2 206/3 205/4
-f 199/1 200/2 207/3 206/4
-f 200/1 201/2 208/3 207/4
-f 201/1 202/2 209/3 208/4
-f 202/1 203/2 210/3 209/4
-f 204/1 205/2 212/3 211/4
-f 205/1 206/2 213/3 212/4
-f 206/1 207/2 214/3 213/4
-f 207/1 208/2 215/3 214/4
-f 208/1 209/2 216/3 215/4
-f 209/1 210/2 217/3 216/4
-f 211/1 212/2 219/3 218/4
-f 212/1 213/2 220/3 219/4
-f 213/1 214/2 221/3 220/4
-f 214/1 215/2 222/3 221/4
-f 215/1 216/2 223/3 222/4
-f 216/1 217/2 224/3 223/4
-f 218/1 219/2 226/3 225/4
-f 219/1 220/2 227/3 226/4
-f 220/1 221/2 228/3 227/4
-f 221/1 222/2 229/3 228/4
-f 222/1 223/2 230/3 229/4
-f 223/1 224/2 231/3 230/4
-f 225/1 226/2 233/3 232/4
-f 226/1 227/2 234/3 233/4
-f 227/1 228/2 235/3 234/4
-f 228/1 229/2 236/3 235/4
-f 229/1 230/2 237/3 236/4
-f 230/1 231/2 238/3 237/4
-f 232/1 233/2 240/3 239/4
-f 233/1 234/2 241/3 240/4
-f 234/1 235/2 242/3 241/4
-f 235/1 236/2 243/3 242/4
-f 236/1 237/2 244/3 243/4
-f 237/1 238/2 245/3 244/4
-f 239/1 240/2 247/3 246/4
-f 240/1 241/2 248/3 247/4
-f 241/1 242/2 249/3 248/4
-f 242/1 243/2 250/3 249/4
-f 243/1 244/2 251/3 250/4
-f 244/1 245/2 252/3 251/4
-f 246/1 247/2 254/3 253/4
-f 247/1 248/2 255/3 254/4
-f 248/1 249/2 256/3 255/4
-f 249/1 250/2 257/3 256/4
-f 250/1 251/2 258/3 257/4
-f 251/1 252/2 259/3 258/4
diff --git a/tests/auto/threed/load_model/tst_load_model.cpp b/tests/auto/threed/load_model/tst_load_model.cpp
deleted file mode 100644
index 65d032a4..00000000
--- a/tests/auto/threed/load_model/tst_load_model.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include "qglabstractscene.h"
-
-class tst_LoadModel : public QObject
-{
- Q_OBJECT
-public:
- tst_LoadModel() {}
- ~tst_LoadModel() {}
-
-private slots:
- void load_data();
- void load();
- void create_data();
- void create();
-};
-
-// Just try to load all the models in the resources file - no checking
-void tst_LoadModel::load_data()
-{
- QString model_path(QLatin1String(":/data/models"));
- QDir data(model_path);
-
- // only load if its a supported format
- QStringList entries = data.entryList(QGLAbstractScene::supportedFormats());
-
- QTest::addColumn<QString>("model");
-
- for (int i = 0; i < entries.size(); ++i)
- QTest::newRow(qPrintable(entries.at(i))) << entries.at(i);
-}
-
-void tst_LoadModel::load()
-{
- QFETCH(QString, model);
-
- QGLAbstractScene *scene = 0;
- QString model_path(QLatin1String(":/data/models/%1"));
- model_path = model_path.arg(model);
-
- QFile f(model_path);
- QVERIFY(f.open(QIODevice::ReadOnly));
-
- QUrl u;
- u.setPath(model_path);
- u.setScheme("file");
-
- scene = QGLAbstractScene::loadScene(&f, u);
- QVERIFY(scene != 0);
-}
-
-void tst_LoadModel::create_data()
-{
- QTest::addColumn<QString>("model");
- QTest::addColumn<QString>("options");
- QTest::addColumn<QString>("importName");
- QTest::addColumn<QString>("nodeName");
- QTest::addColumn<QString>("materialName");
- QTest::addColumn<QRgb>("materialDiffuse");
- QTest::addColumn<QString>("texture");
- QTest::addColumn<int>("expected_vertices");
- QTest::addColumn<int>("expected_indices");
-
- ////// --- OBJ ---
-
- // default is faceted for obj
- QTest::newRow("cube-obj-default")
- << "basic-cube.obj" << ""
- << "basic-cube.obj" << "CubeObject_CubeMesh" << "Red"
- << qRgb(188, 32, 32) << "tex"
- << 24 << 36;
-
- // force a faceted load
- QTest::newRow("cube-obj-faceted")
- << "basic-cube.obj" << "ForceFaceted"
- << "basic-cube.obj" << "CubeObject_CubeMesh" << "Red"
- << qRgb(188, 32, 32) << "tex"
- << 24 << 36;
-
- // force a smooth load
- QTest::newRow("cube-obj-smooth")
- << "basic-cube.obj" << "ForceSmooth"
- << "basic-cube.obj" << "CubeObject_CubeMesh" << "Red"
- << qRgb(188, 32, 32) << "tex"
- << 24 << 36;
-
-
- ////// --- 3DS ---
-
- // default is faceted
- QTest::newRow("cube-3ds-default")
- << "basic-cube.3ds" << ""
- << "basic-cube.3ds" << "CubeObject::SlateGray" << "SlateGray"
- << qRgb(94, 142, 155) << "tex"
- << 12 << 36;
-
- // force smooth
- QTest::newRow("cube-3ds-smooth")
- << "basic-cube.3ds" << "ForceSmooth"
- << "basic-cube.3ds" << "CubeObject::Red" << "Red"
- << qRgb(234, 40, 40) << "tex"
- << 12 << 36;
-
-
- ////// --- wave model ---
-
- // default is faceted
- QTest::newRow("wave-obj-default")
- << "wave.obj" << ""
- << "wave.obj" << "Wave_Obj" << ""
- << qRgb(0, 0, 0) << ""
- << 259 << 1296;
-
- // force smooth
- QTest::newRow("wave-obj-faceted")
- << "wave.obj" << "ForceFaceted"
- << "wave.obj" << "Wave_Obj" << ""
- << qRgb(0, 0, 0) << ""
- << 864 << 1296;
-}
-
-void tst_LoadModel::create()
-{
- QFETCH(QString, model);
- QFETCH(QString, options);
- QFETCH(QString, importName);
- QFETCH(QString, nodeName);
- QFETCH(QString, materialName);
- QFETCH(QRgb, materialDiffuse);
- QFETCH(QString, texture);
- QFETCH(int, expected_vertices);
- QFETCH(int, expected_indices);
-
- if (model == QLatin1String("wave.obj"))
- {
- QSKIP("Fails on Qt5");
- }
-
- QGLAbstractScene *scene = 0;
- QString model_path(QLatin1String(":/data/models/%1"));
- model_path = model_path.arg(model);
-
- QFile f(model_path);
- QVERIFY(f.open(QIODevice::ReadOnly));
-
- QUrl u;
- u.setPath(model_path);
- u.setScheme("file");
-
- scene = QGLAbstractScene::loadScene(&f, u, QString(), options);
- QVERIFY(scene != 0);
-
- QGLSceneNode *node = scene->mainNode();
-
- //qDumpScene(node);
-
- QCOMPARE(node->objectName(), importName);
-
- QGLSceneNode *foundGeometry = 0;
- QGLSceneNode *foundNode = nodeName.isEmpty() ? (QGLSceneNode *)1 : 0;
- QGLSceneNode *foundMaterial = materialName.isEmpty() ? (QGLSceneNode *)1 : 0;
- QList<QGLSceneNode*> list = node->allChildren();
- for (int i = 0; i < list.size(); ++ i)
- {
- if (!foundGeometry && list.at(i)->geometry().count() > 0)
- foundGeometry = list.at(i);
- if (!foundNode && list.at(i)->objectName() == nodeName)
- foundNode = list.at(i);
- if (!foundMaterial && list.at(i)->material() &&
- (list.at(i)->material()->objectName() == materialName))
- foundMaterial = list.at(i);
- }
-
- QVERIFY2(foundGeometry != 0, "A non-null geometry node was not found");
- QVERIFY2(foundNode != 0, qPrintable(nodeName + QLatin1String(" named node not found")));
- QVERIFY2(foundMaterial != 0, qPrintable(materialName + QLatin1String(" named material not found")));
-
- int r, g, b;
- if (!materialName.isEmpty())
- {
- foundMaterial->material()->diffuseColor().getRgb(&r, &g, &b);
- QCOMPARE(materialDiffuse, qRgb(r, g, b));
- }
-
- QGeometryData data = foundGeometry->geometry();
- QVERIFY(data.count() > 0);
-
- QCOMPARE(data.vertices().count(), expected_vertices);
- QCOMPARE(data.normals().count(), expected_vertices);
- QCOMPARE(data.indices().count(), expected_indices);
-}
-
-QTEST_APPLESS_MAIN(tst_LoadModel)
-
-#include "tst_load_model.moc"
diff --git a/tests/auto/threed/qareaallocator/qareaallocator.pro b/tests/auto/threed/qareaallocator/qareaallocator.pro
deleted file mode 100644
index 9834ef78..00000000
--- a/tests/auto/threed/qareaallocator/qareaallocator.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qareaallocator
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qareaallocator.cpp
diff --git a/tests/auto/threed/qareaallocator/tst_qareaallocator.cpp b/tests/auto/threed/qareaallocator/tst_qareaallocator.cpp
deleted file mode 100644
index 40b76faf..00000000
--- a/tests/auto/threed/qareaallocator/tst_qareaallocator.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qareaallocator.h"
-
-class tst_QAreaAllocator : public QObject
-{
- Q_OBJECT
-public:
- tst_QAreaAllocator() {}
- ~tst_QAreaAllocator() {}
-
-private slots:
- void create();
- void allocateSimple();
- void allocateGeneral();
- void allocateUniform();
-};
-
-void tst_QAreaAllocator::create()
-{
- QSimpleAreaAllocator alloc1(QSize(400, 200));
- QCOMPARE(alloc1.size(), QSize(400, 200));
- QCOMPARE(alloc1.minimumAllocation(), QSize(1, 1));
- QCOMPARE(alloc1.margin(), QSize(0, 0));
-
- alloc1.setMinimumAllocation(QSize(5, 7));
- QCOMPARE(alloc1.minimumAllocation(), QSize(5, 7));
-
- alloc1.setMargin(QSize(8, 9));
- QCOMPARE(alloc1.margin(), QSize(8, 9));
-
- alloc1.expand(QSize(300, 21));
- QCOMPARE(alloc1.size(), QSize(400, 200));
-
- alloc1.expand(QSize(300, 210));
- QCOMPARE(alloc1.size(), QSize(400, 210));
-
- alloc1.expand(QSize(3000, 110));
- QCOMPARE(alloc1.size(), QSize(3000, 210));
-
- alloc1.expandBy(QSize(-1, -1000));
- QCOMPARE(alloc1.size(), QSize(3000, 210));
-
- alloc1.expandBy(QSize(1, 10));
- QCOMPARE(alloc1.size(), QSize(3001, 220));
-
- QGeneralAreaAllocator alloc2(QSize(400, 200));
- QCOMPARE(alloc2.size(), QSize(512, 256));
- QCOMPARE(alloc2.minimumAllocation(), QSize(8, 8));
- QCOMPARE(alloc2.margin(), QSize(0, 0));
-
- alloc2.expand(QSize(256, 96));
- QCOMPARE(alloc2.size(), QSize(512, 256));
-
- alloc2.expand(QSize(256, 257));
- QCOMPARE(alloc2.size(), QSize(512, 512));
-
- alloc2.expand(QSize(513, 257));
- QCOMPARE(alloc2.size(), QSize(1024, 512));
-
- alloc2.expandBy(QSize(-100, -100));
- QCOMPARE(alloc2.size(), QSize(1024, 512));
-
- alloc2.expandBy(QSize(1, 2));
- QCOMPARE(alloc2.size(), QSize(2048, 1024));
-
- QUniformAreaAllocator alloc3(QSize(400, 200), QSize(16, 16));
- QCOMPARE(alloc3.size(), QSize(400, 200));
- QCOMPARE(alloc3.minimumAllocation(), QSize(1, 1));
- QCOMPARE(alloc3.margin(), QSize(0, 0));
-
- alloc3.expand(QSize(256, 96));
- QCOMPARE(alloc3.size(), QSize(400, 200));
-
- alloc3.expand(QSize(256, 257));
- QCOMPARE(alloc3.size(), QSize(400, 257));
-
- alloc3.expand(QSize(513, 257));
- QCOMPARE(alloc3.size(), QSize(513, 257));
-
- alloc3.expandBy(QSize(-100, -100));
- QCOMPARE(alloc3.size(), QSize(513, 257));
-
- alloc3.expandBy(QSize(1, 2));
- QCOMPARE(alloc3.size(), QSize(514, 259));
-}
-
-void tst_QAreaAllocator::allocateSimple()
-{
- // The simple allocator returns regions in a left-to-right,
- // top-to-bottom order across the image extents.
- QSimpleAreaAllocator alloc1(QSize(100, 100));
- QRect rect;
- for (int y = 0; y < 10; ++y) {
- for (int x = 0; x < 10; ++x) {
- rect = alloc1.allocate(QSize(10, 10));
- QCOMPARE(rect, QRect(x * 10, y * 10, 10, 10));
- }
- }
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(rect.isNull());
-
- // Release doesn't do anything on the simple allocator.
- alloc1.release(QRect(0, 0, 10, 10));
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(rect.isNull());
-
- // Test minimum allocation sizes.
- QSimpleAreaAllocator alloc2(QSize(100, 100));
- alloc2.setMinimumAllocation(QSize(10, 5));
- for (int y = 0; y < 10; ++y) {
- for (int x = 0; x < 10; ++x) {
- rect = alloc2.allocate(QSize(x + 1, y + 1));
- if (y < 5)
- QCOMPARE(rect, QRect(x * 10, y * 5, x + 1, y + 1));
- else
- QCOMPARE(rect, QRect(x * 10, (y - 5) * 10 + 25, x + 1, y + 1));
- }
- }
- rect = alloc2.allocate(QSize(10, 10));
- QCOMPARE(rect, QRect(0, 75, 10, 10)); // Still some space left over.
- rect = alloc2.allocate(QSize(10, 26)); // Won't fit.
- QVERIFY(rect.isNull());
- rect = alloc2.allocate(QSize(10, 10)); // Should still fit.
- QCOMPARE(rect, QRect(10, 75, 10, 10));
-}
-
-void tst_QAreaAllocator::allocateGeneral()
-{
- QGeneralAreaAllocator alloc1(QSize(128, 128));
- QRect rect;
- QList<QRect> allocations;
- for (int y = 0; y < 16; ++y) {
- for (int x = 0; x < 16; ++x) {
- // The order in which allocations are returned is not
- // as predictable as QSimpleAreaAllocator. But we can
- // ensure that all allocations are unique and 8x8-aligned.
- rect = alloc1.allocate(QSize(8, 8));
- QVERIFY((rect.x() % 8) == 0);
- QVERIFY((rect.y() % 8) == 0);
- QVERIFY((rect.height() % 8) == 0);
- QVERIFY((rect.height() % 8) == 0);
- QVERIFY(!allocations.contains(rect));
- allocations += rect;
- }
- }
- QCOMPARE(allocations.size(), 256);
- rect = alloc1.allocate(QSize(8, 8));
- QVERIFY(rect.isNull());
-
- // Double the width and height and then do some more allocations at 16x16.
- alloc1.expandBy(QSize(1, 1));
- for (int z = 0; z < 3; ++z) {
- for (int y = 0; y < 8; ++y) {
- for (int x = 0; x < 8; ++x) {
- rect = alloc1.allocate(QSize(16, 16));
- QVERIFY((rect.x() % 8) == 0);
- QVERIFY((rect.y() % 8) == 0);
- QVERIFY((rect.height() % 16) == 0);
- QVERIFY((rect.height() % 16) == 0);
- QVERIFY(!allocations.contains(rect));
- allocations += rect;
- }
- }
- }
- QCOMPARE(allocations.size(), 256 + 3 * 8 * 8);
- rect = alloc1.allocate(QSize(8, 8));
- QVERIFY(rect.isNull());
-
- // Release the 8x8 allocations.
- for (int y = 0; y < 16; ++y)
- for (int x = 0; x < 16; ++x)
- alloc1.release(QRect(x * 8, y * 8, 8, 8));
- rect = alloc1.allocate(QSize(8, 8));
- QVERIFY(!rect.isNull());
- alloc1.release(rect);
-
- // Allocate some other sizes into the gap we've just made.
- rect = alloc1.allocate(QSize(256, 256)); // Too big.
- QVERIFY(rect.isNull());
- rect = alloc1.allocate(QSize(64, 128));
- QVERIFY(!rect.isNull());
- rect = alloc1.allocate(QSize(64, 64));
- QVERIFY(!rect.isNull());
- rect = alloc1.allocate(QSize(64, 48)); // Over-allocates to 64x64.
- QVERIFY(!rect.isNull());
- rect = alloc1.allocate(QSize(8, 8)); // Will fail.
- QVERIFY(rect.isNull());
-}
-
-void tst_QAreaAllocator::allocateUniform()
-{
- // The uniform allocator initially returns regions in a
- // left-to-right, top-to-bottom order across the image extents.
- QUniformAreaAllocator alloc1(QSize(100, 100), QSize(10, 10));
- QRect rect;
- for (int y = 0; y < 10; ++y) {
- for (int x = 0; x < 10; ++x) {
- rect = alloc1.allocate(QSize(10, 10));
- QCOMPARE(rect, QRect(x * 10, y * 10, 10, 10));
- }
- }
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(rect.isNull());
-
- // Release some areas and then allocate again. Should act like a stack.
- rect = QRect(60, 50, 10, 10);
- QRect rect2 = QRect(50, 40, 10, 10);
- alloc1.release(rect);
- alloc1.release(rect2);
- QCOMPARE(alloc1.allocate(QSize(10, 10)), rect2);
- QCOMPARE(alloc1.allocate(QSize(10, 10)), rect);
- QVERIFY(alloc1.allocate(QSize(10, 10)).isNull());
-
- // Expand the allocation area.
- alloc1.release(rect); // Copy across at least 1 free list entry.
- alloc1.expandBy(QSize(10, 10));
- for (int count = 0; count < 22; ++count) {
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(!rect.isNull());
- }
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(rect.isNull());
-
- // Release everything and then reallocate.
- for (int y = 0; y < 11; ++y) {
- for (int x = 0; x < 11; ++x)
- alloc1.release(QRect(x * 10, y * 10, 10, 10));
- }
- for (int count = 0; count < (11 * 11); ++count) {
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(!rect.isNull());
- }
- rect = alloc1.allocate(QSize(10, 10));
- QVERIFY(rect.isNull());
-}
-
-QTEST_APPLESS_MAIN(tst_QAreaAllocator)
-
-#include "tst_qareaallocator.moc"
diff --git a/tests/auto/threed/qarray/qarray.pro b/tests/auto/threed/qarray/qarray.pro
deleted file mode 100644
index 5c28c5a6..00000000
--- a/tests/auto/threed/qarray/qarray.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qarray
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qarray.cpp
diff --git a/tests/auto/threed/qarray/tst_qarray.cpp b/tests/auto/threed/qarray/tst_qarray.cpp
deleted file mode 100644
index 3a7f36f2..00000000
--- a/tests/auto/threed/qarray/tst_qarray.cpp
+++ /dev/null
@@ -1,1862 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qarray.h"
-#include <QtGui/qvector3d.h>
-#include <QtCore/qstring.h>
-
-// We ensure to test the following types to cover all of the
-// relevant QTypeInfo variations:
-//
-// QArray<float> Primitive types
-// QArray<QString> Movable types
-// QArray<ComplexValue> Complex types
-
-class tst_QArray : public QObject
-{
- Q_OBJECT
-public:
- tst_QArray() {}
- ~tst_QArray() {}
-
-private slots:
- void create();
- void append();
- void appendTwoAtATime();
- void appendThreeAtATime();
- void appendFourAtATime();
- void appendArray();
- void setAt();
- void value();
- void replace();
- void copy();
- void resize();
- void reserve();
- void squeeze();
- void compare();
- void remove();
- void removeFirstLast();
- void extend();
- void reverse();
- void reversed();
- void mid();
- void left();
- void right();
- void iterate();
- void copyPrealloc();
- void insert();
- void fromRawData();
- void fromWritableRawData();
- void search();
- void fill();
- void zeroPrealloc();
- void exceptions();
- void dataStream();
-};
-
-// This must match the default for PreallocSize.
-static const int ExpectedMinCapacity = 8;
-
-// Exception type that is thrown by ComplexValue.
-class ComplexValueException
-{
-public:
- ComplexValueException(int value, bool inCtor)
- : m_value(value), m_inCtor(inCtor) {}
-
- int value() const { return m_value; }
- bool inConstructor() const { return m_inCtor; }
-
-private:
- int m_value;
- bool m_inCtor;
-};
-
-// Complex type that helps the tests determine if QArray is calling
-// constructors, destructors, and copy constructors in the right places.
-class ComplexValue
-{
-public:
- enum Mode
- {
- Default,
- Init,
- Copy,
- CopiedAgain,
- Assign,
- ThrowInCtor,
- ThrowOnCopy
- };
-
- static int destroyCount;
-
- ComplexValue() : m_value(-1), m_mode(Default) {}
- ComplexValue(int value) : m_value(value), m_mode(Init) {}
-#ifndef QT_NO_EXCEPTIONS
- ComplexValue(int value, Mode mode) : m_value(value), m_mode(mode)
- {
- if (mode == ThrowInCtor)
- throw new ComplexValueException(value, true);
- }
-#endif
- ComplexValue(const ComplexValue& other)
- : m_value(other.m_value)
- {
- if (other.m_mode == Copy || other.m_mode == CopiedAgain)
- m_mode = CopiedAgain;
-#ifndef QT_NO_EXCEPTIONS
- else if (other.m_mode == ThrowOnCopy)
- throw new ComplexValueException(other.m_value, false);
-#endif
- else
- m_mode = Copy;
- }
- ~ComplexValue() { ++destroyCount; }
-
- ComplexValue& operator=(const ComplexValue& other)
- {
-#ifndef QT_NO_EXCEPTIONS
- if (other.m_mode == ThrowOnCopy)
- throw new ComplexValueException(other.m_value, false);
-#endif
- m_value = other.m_value;
- m_mode = Assign;
- return *this;
- }
-
- int value() const { return m_value; }
- Mode mode() const { return m_mode; }
-
- bool operator==(const ComplexValue& other) const
- { return m_value == other.m_value; }
- bool operator==(int other) const
- { return m_value == other; }
- bool operator!=(const ComplexValue& other) const
- { return m_value != other.m_value; }
- bool operator!=(int other) const
- { return m_value != other; }
-
-private:
- int m_value;
- Mode m_mode;
-};
-
-int ComplexValue::destroyCount = 0;
-
-void tst_QArray::create()
-{
- QArray<float> array;
-
- // Check the basic properties.
- QVERIFY(array.isEmpty());
- QCOMPARE(array.count(), 0);
- QCOMPARE(array.size(), 0);
- QCOMPARE(array.capacity(), ExpectedMinCapacity);
- QVERIFY(array.constData() != 0);
- QVERIFY(array.data() == array.constData());
- QVERIFY(((const QArray<float> *)&array)->data() == array.constData());
-
- // The current constData() pointer should be pointing into
- // the middle of "array" at the m_prealloc structure.
- const float *d = array.constData();
- QVERIFY(d >= (const float *)&array);
- QVERIFY(d < (const float *)((&array) + 1));
-
- // Add one element and check the basic properties again.
- array.append(1.0f);
- QVERIFY(!array.isEmpty());
- QCOMPARE(array.count(), 1);
- QCOMPARE(array.size(), 1);
- QCOMPARE(array.capacity(), ExpectedMinCapacity);
- QVERIFY(array.constData() != 0);
- QVERIFY(array.data() == array.constData());
- QVERIFY(((const QArray<float> *)&array)->data() == array.constData());
-
- // Create another array that is filled with an initial value.
- QArray<QVector3D> array2(100, QVector3D(1.0f, 2.0f, 3.0f));
- QVERIFY(!array2.isEmpty());
- QCOMPARE(array2.count(), 100);
- QCOMPARE(array2.size(), 100);
- QVERIFY(array2.capacity() >= 100);
- QVERIFY(array2.constData() != 0);
- QVERIFY(array2.data() == array2.constData());
- QVERIFY(((const QArray<QVector3D> *)&array2)->data() == array2.constData());
- for (int index = 0; index < 100; ++index)
- QVERIFY(array2.at(index) == QVector3D(1.0f, 2.0f, 3.0f));
-
- // Create a filled array that is within the prealloc area.
- QArray<float> array3(ExpectedMinCapacity, 42.5f);
- QVERIFY(!array3.isEmpty());
- QCOMPARE(array3.count(), ExpectedMinCapacity);
- QCOMPARE(array3.size(), ExpectedMinCapacity);
- QVERIFY(array3.capacity() == ExpectedMinCapacity);
- QVERIFY(array3.constData() != 0);
- QVERIFY(array3.data() == array3.constData());
- for (int index = 0; index < ExpectedMinCapacity; ++index)
- QVERIFY(array3.at(index) == 42.5f);
-
- // Create an array of strings.
- QArray<QString> array4;
- QCOMPARE(array4.size(), 0);
- array4.append(QLatin1String("foo"));
- array4.append(QLatin1String("bar"));
- array4.append(array4[0]);
- QCOMPARE(array4[0], QLatin1String("foo"));
- QCOMPARE(array4[1], QLatin1String("bar"));
- QCOMPARE(array4[2], QLatin1String("foo"));
-
- // Create an array of complex values and check that the
- // copy constructors were called correctly. Also check that
- // the destructors are called when the array is destroyed.
- ComplexValue::destroyCount = 0;
- {
- QArray<ComplexValue> array5;
- array5.append(ComplexValue(1));
- array5.append(ComplexValue(2));
- array5.append(ComplexValue(3));
- QCOMPARE(ComplexValue::destroyCount, 3); // Destruction of temporaries.
- QCOMPARE(array5.size(), 3);
- QVERIFY(array5[0].value() == 1);
- QVERIFY(array5[0].mode() == ComplexValue::Copy);
- QVERIFY(array5[1].value() == 2);
- QVERIFY(array5[1].mode() == ComplexValue::Copy);
- QVERIFY(array5[2].value() == 3);
- QVERIFY(array5[2].mode() == ComplexValue::Copy);
- }
- QCOMPARE(ComplexValue::destroyCount, 6);
-}
-
-void tst_QArray::append()
-{
- QArray<float> array;
- int index;
-
- // Appending up to the minimum capacity should not cause a realloc.
- const float *d = array.constData();
- for (index = 0; index < ExpectedMinCapacity; ++index) {
- array.append(float(index));
- QVERIFY(array.constData() == d);
- }
-
- // Check that the array contains the values we expected.
- QCOMPARE(array.count(), ExpectedMinCapacity);
- QCOMPARE(array.capacity(), ExpectedMinCapacity);
- for (index = 0; index < ExpectedMinCapacity; ++index) {
- QCOMPARE(array[index], float(index));
- }
-
- // Append 1 more item and check for realloc.
- array += float(1000.0f);
- QCOMPARE(array.count(), ExpectedMinCapacity + 1);
- QVERIFY(array.capacity() > ExpectedMinCapacity);
- QVERIFY(array.capacity() >= array.count());
- QCOMPARE(array.size(), array.count());
-
- // Check that the array still contains the values we expected.
- for (index = 0; index < ExpectedMinCapacity; ++index) {
- QCOMPARE(array[index], float(index));
- }
- QCOMPARE(array[ExpectedMinCapacity], 1000.0f);
-
- // Append a large number of values to test constant reallocation.
- for (index = 0; index < 1000; ++index)
- array.append(float(index));
- QCOMPARE(array.count(), ExpectedMinCapacity + 1 + 1000);
- QCOMPARE(array.size(), array.count());
-
- // Make two copies of the array.
- QVERIFY(array.isDetached());
- QArray<float> array2(array);
- QVERIFY(!array.isDetached());
- QVERIFY(!array2.isDetached());
- QCOMPARE(array2.count(), ExpectedMinCapacity + 1 + 1000);
- QCOMPARE(array2.size(), array2.count());
- QVERIFY(!array2.isEmpty());
- QVERIFY(array2.capacity() >= array2.size());
- QArray<float> array3;
- array3 = array;
- QCOMPARE(array3.count(), ExpectedMinCapacity + 1 + 1000);
- QCOMPARE(array3.size(), array3.count());
- QVERIFY(!array3.isEmpty());
- QVERIFY(array3.capacity() >= array3.size());
-
- // Check that we actually are sharing the data between the copies.
- QVERIFY(array.constData() == array2.constData());
- QVERIFY(array.constData() == array3.constData());
- d = array2.constData();
-
- // Add another item to the original and check that the copy is unchanged.
- array << float(1500.0f);
- QVERIFY(array.isDetached());
- QCOMPARE(array.count(), ExpectedMinCapacity + 1 + 1000 + 1);
- QCOMPARE(array2.count(), ExpectedMinCapacity + 1 + 1000);
- QCOMPARE(array3.count(), ExpectedMinCapacity + 1 + 1000);
-
- // Check that we have detached the first array (copy-on-write).
- QVERIFY(array.constData() != array2.constData());
- QVERIFY(array.constData() != array3.constData());
- QVERIFY(array2.constData() == array3.constData());
- QVERIFY(array2.constData() == d);
-
- // Check that the original and the copy contain the right values.
- for (index = 0; index < ExpectedMinCapacity; ++index) {
- QCOMPARE(array.at(index), float(index));
- QCOMPARE(array2.at(index), float(index));
- QCOMPARE(array3.at(index), float(index));
- }
- QCOMPARE(array.at(ExpectedMinCapacity), 1000.0f);
- QCOMPARE(array2.at(ExpectedMinCapacity), 1000.0f);
- QCOMPARE(array3.at(ExpectedMinCapacity), 1000.0f);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array.at(index + ExpectedMinCapacity + 1), float(index));
- }
- QCOMPARE(array[ExpectedMinCapacity + 1000 + 1], 1500.0f);
-
- // Check the detach conditions.
- QVERIFY(!array2.isDetached());
- QVERIFY(!array3.isDetached());
- array3.append(1.0f);
- QVERIFY(array3.isDetached());
- QVERIFY(!array2.isDetached()); // Still thinks it is shared.
- array2.data();
- QVERIFY(array2.isDetached()); // Now knows that it isn't.
-
- // Create a large array of strings.
- QArray<QString> array4;
- for (index = 0; index < 1000; ++index)
- array4.append(QString::number(index));
- QCOMPARE(array4.size(), 1000);
- for (index = 0; index < 1000; ++index)
- QVERIFY(array4[index] == QString::number(index));
-
- // Make a copy of the array of strings and then force a detach.
- QArray<QString> array5(array4);
- QCOMPARE(array4.size(), 1000);
- QCOMPARE(array5.size(), 1000);
- for (index = 0; index < 1000; ++index) {
- QVERIFY(array4[index] == QString::number(index));
- QVERIFY(array5[index] == QString::number(index));
- }
- array5.append(QString::number(1000));
- QCOMPARE(array4.size(), 1000);
- QCOMPARE(array5.size(), 1001);
- for (index = 0; index < 1000; ++index) {
- QVERIFY(array4[index] == QString::number(index));
- QVERIFY(array5[index] == QString::number(index));
- }
- QVERIFY(array5[1000] == QString::number(1000));
-
- // Create an array of complex values and force one realloc
- // to test that copy constructors and destructors are called
- // when moving data from the prealloc array to the heap.
- QArray<ComplexValue> array6;
- ComplexValue::destroyCount = 0;
- for (index = 0; index < ExpectedMinCapacity; ++index)
- array6.append(ComplexValue(index));
- QCOMPARE(ComplexValue::destroyCount, ExpectedMinCapacity);
- ComplexValue::destroyCount = 0;
- array6.append(ComplexValue(ExpectedMinCapacity));
- QCOMPARE(ComplexValue::destroyCount, ExpectedMinCapacity + 1);
- for (index = 0; index < (ExpectedMinCapacity + 1); ++index) {
- QCOMPARE(array6[index].value(), index);
- // The last element should be Copy, but all others are CopiedAgain.
- if (index == ExpectedMinCapacity)
- QVERIFY(array6[index].mode() == ComplexValue::Copy);
- else
- QVERIFY(array6[index].mode() == ComplexValue::CopiedAgain);
- }
-
- // Force another realloc to test heap to heap copies.
- int capacity = array6.capacity();
- for (int index = array6.size(); index < capacity; ++index)
- array6.append(ComplexValue(index));
- ComplexValue::destroyCount = 0;
- array6.append(ComplexValue(capacity));
- QCOMPARE(ComplexValue::destroyCount, capacity + 1);
- for (index = 0; index < (capacity + 1); ++index) {
- QCOMPARE(array6[index].value(), index);
- // The last element should be Copy, but all others are CopiedAgain.
- if (index == capacity)
- QVERIFY(array6[index].mode() == ComplexValue::Copy);
- else
- QVERIFY(array6[index].mode() == ComplexValue::CopiedAgain);
- }
-
- // Make a copy of array6 and force a detach.
- int size = array6.size();
- QArray<ComplexValue> array7(array6);
- QCOMPARE(array6.size(), size);
- QCOMPARE(array7.size(), size);
- for (index = 0; index < size; ++index) {
- QVERIFY(array6[index].value() == index);
- QVERIFY(array7[index].value() == index);
- }
- array7.append(ComplexValue(size));
- QCOMPARE(array6.size(), size);
- QCOMPARE(array7.size(), size + 1);
- for (index = 0; index < size; ++index) {
- QVERIFY(array6[index].value() == index);
- QVERIFY(array7[index].value() == index);
- }
- QVERIFY(array7[size].value() == size);
-
- // Make another copy using operator=.
- QArray<ComplexValue> array8;
- QCOMPARE(array8.size(), 0);
- array8 = array6;
- QCOMPARE(array6.size(), size);
- QCOMPARE(array8.size(), size);
- for (index = 0; index < size; ++index) {
- QVERIFY(array6[index].value() == index);
- QVERIFY(array8[index].value() == index);
- }
- array8.append(ComplexValue(size));
- QCOMPARE(array6.size(), size);
- QCOMPARE(array8.size(), size + 1);
- for (index = 0; index < size; ++index) {
- QVERIFY(array6[index].value() == index);
- QVERIFY(array8[index].value() == index);
- }
- QVERIFY(array8[size].value() == size);
-
- // Copy the same object over itself.
- QArray<ComplexValue> array9(array8);
- QVERIFY(array9.constData() == array8.constData());
- for (index = 0; index < array8.size(); ++index)
- QCOMPARE((*((const QArray<ComplexValue> *)&array9))[index],
- array8.at(index));
- array9 = array8;
- QVERIFY(array9.constData() == array8.constData());
- for (index = 0; index < array8.size(); ++index)
- QCOMPARE(array9.at(index), array8.at(index));
-}
-
-void tst_QArray::appendTwoAtATime()
-{
- int index;
-
- QArray<float> array;
- array.append(1.0f, 2.0f);
- array.append(3.0f, 4.0f);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
- QCOMPARE(array.count(), 4);
-
- QArray<float> array2;
- for (index = 0; index < 1000; ++index)
- array2.append(float(index), float(index + 1));
- QCOMPARE(array2.count(), 2000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array2[index * 2], float(index));
- QCOMPARE(array2[index * 2 + 1], float(index + 1));
- }
-
- QArray<QString> array3;
- for (index = 0; index < 1000; ++index)
- array3.append(QString::number(index), QString::number(index + 1));
- QCOMPARE(array3.count(), 2000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array3[index * 2], QString::number(index));
- QCOMPARE(array3[index * 2 + 1], QString::number(index + 1));
- }
-
- QArray<ComplexValue> array4;
- for (index = 0; index < 1000; ++index)
- array4.append(ComplexValue(index), ComplexValue(index + 1));
- QCOMPARE(array4.count(), 2000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array4[index * 2].value(), index);
- QCOMPARE(array4[index * 2 + 1].value(), index + 1);
- }
-}
-
-void tst_QArray::appendThreeAtATime()
-{
- int index;
-
- QArray<float> array;
- array.append(1.0f, 2.0f, 3.0f);
- array.append(4.0f, 5.0f, 6.0f);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
- QCOMPARE(array[4], 5.0f);
- QCOMPARE(array[5], 6.0f);
- QCOMPARE(array.count(), 6);
-
- QArray<float> array2;
- for (index = 0; index < 1000; ++index)
- array2.append(float(index), float(index + 1), float(index + 2));
- QCOMPARE(array2.count(), 3000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array2[index * 3], float(index));
- QCOMPARE(array2[index * 3 + 1], float(index + 1));
- QCOMPARE(array2[index * 3 + 2], float(index + 2));
- }
-
- QArray<QString> array3;
- for (index = 0; index < 1000; ++index)
- array3.append(QString::number(index), QString::number(index + 1),
- QString::number(index + 2));
- QCOMPARE(array3.count(), 3000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array3[index * 3], QString::number(index));
- QCOMPARE(array3[index * 3 + 1], QString::number(index + 1));
- QCOMPARE(array3[index * 3 + 2], QString::number(index + 2));
- }
-
- QArray<ComplexValue> array4;
- for (index = 0; index < 1000; ++index)
- array4.append(ComplexValue(index), ComplexValue(index + 1),
- ComplexValue(index + 2));
- QCOMPARE(array4.count(), 3000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array4[index * 3].value(), index);
- QCOMPARE(array4[index * 3 + 1].value(), index + 1);
- QCOMPARE(array4[index * 3 + 2].value(), index + 2);
- }
-}
-
-void tst_QArray::appendFourAtATime()
-{
- int index;
-
- QArray<float> array;
- array.append(1.0f, 2.0f, 3.0f, 4.0f);
- array.append(5.0f, 6.0f, 7.0f, 8.0f);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
- QCOMPARE(array[4], 5.0f);
- QCOMPARE(array[5], 6.0f);
- QCOMPARE(array[6], 7.0f);
- QCOMPARE(array[7], 8.0f);
- QCOMPARE(array.count(), 8);
-
- QArray<float> array2;
- for (index = 0; index < 1000; ++index)
- array2.append(float(index), float(index + 1), float(index + 2), float(index + 3));
- QCOMPARE(array2.count(), 4000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array2[index * 4], float(index));
- QCOMPARE(array2[index * 4 + 1], float(index + 1));
- QCOMPARE(array2[index * 4 + 2], float(index + 2));
- QCOMPARE(array2[index * 4 + 3], float(index + 3));
- }
-
- QArray<QString> array3;
- for (index = 0; index < 1000; ++index)
- array3.append(QString::number(index), QString::number(index + 1),
- QString::number(index + 2), QString::number(index + 3));
- QCOMPARE(array3.count(), 4000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array3[index * 4], QString::number(index));
- QCOMPARE(array3[index * 4 + 1], QString::number(index + 1));
- QCOMPARE(array3[index * 4 + 2], QString::number(index + 2));
- QCOMPARE(array3[index * 4 + 3], QString::number(index + 3));
- }
-
- QArray<ComplexValue> array4;
- for (index = 0; index < 1000; ++index)
- array4.append(ComplexValue(index), ComplexValue(index + 1),
- ComplexValue(index + 2), ComplexValue(index + 3));
- QCOMPARE(array4.count(), 4000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array4[index * 4].value(), index);
- QCOMPARE(array4[index * 4 + 1].value(), index + 1);
- QCOMPARE(array4[index * 4 + 2].value(), index + 2);
- QCOMPARE(array4[index * 4 + 3].value(), index + 3);
- }
-}
-
-void tst_QArray::appendArray()
-{
- QArray<float> array;
- QArray<float> array2;
- int index;
-
- for (index = 0; index < 1000; ++index) {
- array.append(index);
- array2.append(1000 - index);
- }
-
- array.append(array2);
- QCOMPARE(array.count(), 2000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array[index], float(index));
- QCOMPARE(array[index + 1000], float(1000 - index));
- }
-
- array2 << array2;
- QCOMPARE(array2.count(), 2000);
- for (index = 0; index < 1000; ++index) {
- QCOMPARE(array2[index], float(1000 - index));
- QCOMPARE(array2[index + 1000], float(1000 - index));
- }
-
- array2 += (QArray<float>());
- QCOMPARE(array2.count(), 2000);
-
- QArray<float> array3(array2.constData(), array2.size());
- QCOMPARE(array3.size(), array2.size());
- for (index = 0; index < array2.size(); ++index)
- QCOMPARE(array3.at(index), array2.at(index));
-}
-
-void tst_QArray::setAt()
-{
- int index;
-
- QArray<float> array;
- array.append(1.0f);
- QCOMPARE(array[0], 1.0f);
-
- array[0] = 6.0f;
- QCOMPARE(array[0], 6.0f);
-
- QArray<float> array2;
- for (index = 0; index < 1000; ++index)
- array2.append(index);
- for (index = 0; index < 1000; ++index)
- array2[index] = index + 1000;
- for (index = 0; index < 1000; ++index)
- QCOMPARE(array2[index], float(index + 1000));
- for (index = 0; index < 1000; ++index)
- array2.replace(index, float(-index));
- for (index = 0; index < 1000; ++index)
- QCOMPARE(array2[index], float(-index));
-}
-
-void tst_QArray::value()
-{
- QArray<float> array;
- for (int index = 0; index < 1000; ++index)
- array.append(float(index));
-
- for (int index = 0; index < 1000; ++index) {
- QCOMPARE(array.value(index), float(index));
- QCOMPARE(array.value(index, 10001.0f), float(index));
- }
-
- QCOMPARE(array.value(-1), 0.0f);
- QCOMPARE(array.value(1000), 0.0f);
-
- QCOMPARE(array.value(-1, 10001.0f), 10001.0f);
- QCOMPARE(array.value(1000, 10001.0f), 10001.0f);
-}
-
-void tst_QArray::replace()
-{
- QArray<float> array;
- QArray<float> array2;
- int index;
-
- for (index = 0; index < 1000; ++index) {
- array.append(index);
- array2.append(1000 - index);
- }
-
- array.replace(500, array2.constData(), 500);
- QCOMPARE(array.count(), 1000);
- for (index = 0; index < 1000; ++index) {
- if (index < 500)
- QCOMPARE(array[index], float(index));
- else
- QCOMPARE(array[index], float(1000 - (index - 500)));
- }
-
- // Replace and extend the array from the middle.
- array.replace(900, array2.constData(), 500);
- QCOMPARE(array.count(), 1400);
- for (index = 0; index < 1400; ++index) {
- if (index < 500)
- QCOMPARE(array[index], float(index));
- else if (index < 900)
- QCOMPARE(array[index], float(1000 - (index - 500)));
- else
- QCOMPARE(array[index], float(1000 - (index - 900)));
- }
-
- // Check the bail-out cases when index is negative or count zero.
- array.replace(900, array2.constData(), 0);
- array.replace(-1, array2.constData(), 900);
- QCOMPARE(array.count(), 1400);
- for (index = 0; index < 1400; ++index) {
- if (index < 500)
- QCOMPARE(array[index], float(index));
- else if (index < 900)
- QCOMPARE(array[index], float(1000 - (index - 500)));
- else
- QCOMPARE(array[index], float(1000 - (index - 900)));
- }
-
- // Replace beyond the end of the array.
- static float const extras[] = {0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 4.0f};
- array.replace(1402, extras + 2, 4);
- QCOMPARE(array.count(), 1406);
- for (index = 0; index < 1406; ++index) {
- if (index < 500)
- QCOMPARE(array[index], float(index));
- else if (index < 900)
- QCOMPARE(array[index], float(1000 - (index - 500)));
- else if (index < 1400)
- QCOMPARE(array[index], float(1000 - (index - 900)));
- else
- QCOMPARE(array[index], extras[index - 1400]);
- }
-
- QArray<ComplexValue> array3;
- QArray<ComplexValue> array4;
- for (index = 0; index < 1000; ++index) {
- array3.append(ComplexValue(index));
- array4.append(ComplexValue(1000 - index));
- }
- array3.replace(0, array4.constData(), array4.size());
- for (index = 0; index < 1000; ++index)
- QVERIFY(array3[index] == array4[index]);
-}
-
-// Exercise the various conditionals in operator=().
-void tst_QArray::copy()
-{
- QArray<float> array, array2, array3;
-
- array2.append(1.0f);
- array2.append(7.0f);
- array = array2;
- QCOMPARE(array.count(), 2);
- QCOMPARE(array.at(0), float(1.0f));
- QCOMPARE(array.at(1), float(7.0f));
-
- array = array3;
- QCOMPARE(array.count(), 0);
-
- array2 = array2;
- QCOMPARE(array2.count(), 2);
- QCOMPARE(array2.at(0), float(1.0f));
- QCOMPARE(array2.at(1), float(7.0f));
-
- QArray<float> array4(array2);
- QCOMPARE(array2.count(), 2);
- QCOMPARE(array2.at(0), float(1.0f));
- QCOMPARE(array2.at(1), float(7.0f));
-
- QArray<float> array5, array6;
- for (int index = 0; index < 32; ++index)
- array5.append(2.0f);
- QCOMPARE(array5.count(), 32);
- array6.append(1.0f);
- array5 = array6;
- QCOMPARE(array5.count(), 1);
- QCOMPARE(array5.at(0), float(1.0f));
-
- array5.clear();
- QCOMPARE(array5.count(), 0);
- QCOMPARE(array6.count(), 1);
- QCOMPARE(array6.at(0), float(1.0f));
- array6.clear();
- QCOMPARE(array5.count(), 0);
-}
-
-void tst_QArray::resize()
-{
- QArray<int> array;
-
- array.resize(-1);
- QCOMPARE(array.count(), 0);
-
- array.resize(ExpectedMinCapacity);
- QCOMPARE(array.count(), ExpectedMinCapacity);
- for (int index = 0; index < ExpectedMinCapacity; ++index)
- QCOMPARE(array[index], 0);
- array.append(1);
-
- array.resize(100);
- QCOMPARE(array.count(), 100);
- QVERIFY(array.capacity() >= 100);
- int cap = array.capacity();
- for (int index = 0; index < 100; ++index){
- if (index != 8)
- QCOMPARE(array[index], 0);
- else
- QCOMPARE(array[index], 1);
- }
-
- array.resize(50);
- QCOMPARE(array.count(), 50);
- QVERIFY(array.capacity() == cap); // Shouldn't change the capacity.
- for (int index = 0; index < 50; ++index){
- if (index != 8)
- QCOMPARE(array[index], 0);
- else
- QCOMPARE(array[index], 1);
- }
-
- array.resize(50);
- QCOMPARE(array.count(), 50);
-
- QArray<int> array2(array);
- array.resize(40);
- QCOMPARE(array.count(), 40);
- QCOMPARE(array2.count(), 50);
-
- array2.resize(20);
- QCOMPARE(array2.count(), 20);
-
- for (int index = 0; index < 40; ++index){
- if (index != 8)
- QCOMPARE(array[index], 0);
- else
- QCOMPARE(array[index], 1);
- }
- for (int index = 0; index < 20; ++index){
- if (index != 8)
- QCOMPARE(array2[index], 0);
- else
- QCOMPARE(array2[index], 1);
- }
-
- // Check that resizing to zero keeps the same memory storage.
- const int *d = array.constData();
- array.resize(0);
- QVERIFY(array.constData() == d);
- QVERIFY(array.capacity() != ExpectedMinCapacity);
-
- // Calling clear will reclaim the storage.
- array.clear();
- QVERIFY(array.constData() != d);
- QVERIFY(array.capacity() == ExpectedMinCapacity);
-}
-
-void tst_QArray::reserve()
-{
- QArray<float> array;
- array.reserve(1000);
- QVERIFY(array.isEmpty());
- QVERIFY(array.capacity() >= 1000);
-
- // Append elements and check for reallocation.
- const float *d = array.constData();
- for (int index = 0; index < 1000; ++index) {
- array.append(float(index));
- QVERIFY(array.constData() == d);
- }
-
- // Reserving less doesn't change the capacity, or the count.
- array.reserve(50);
- QVERIFY(array.capacity() >= 1000);
- QCOMPARE(array.count(), 1000);
-}
-
-void tst_QArray::squeeze()
-{
- QArray<float> array;
- array.reserve(100);
- QVERIFY(array.isEmpty());
- QVERIFY(array.capacity() >= 100);
-
- for (int index = 0; index < 100; ++index)
- array.append(float(index));
-
- array.reserve(400);
- QVERIFY(array.capacity() >= 400);
-
- array.squeeze();
- QCOMPARE(array.capacity(), 100);
- QCOMPARE(array.count(), 100);
-
- // Test squeezing within the preallocated area.
- QArray<float> array2;
- array2.append(1.0f);
- array2.append(2.0f);
- array2.append(3.0f);
- array2.squeeze();
- QCOMPARE(array2.capacity(), ExpectedMinCapacity);
- QCOMPARE(array2.count(), 3);
-
- // Test copy-on-write during squeezing.
- QArray<float> array3(array);
- array3.squeeze();
- QCOMPARE(array3.count(), 100);
- QCOMPARE(array.count(), 100);
-
- // Clear and check that the array reverts to preallocation.
- array.resize(0);
- array.squeeze();
- QCOMPARE(array.size(), 0);
- QCOMPARE(array.capacity(), ExpectedMinCapacity);
-}
-
-void tst_QArray::compare()
-{
- QArray<float> array, array2, array3;
-
- QVERIFY(array == array2);
-
- array.append(1.0f);
- array3.append(1.0f);
- QArray<float> array4(array);
-
- QVERIFY(array == array);
- QVERIFY(array != array2);
- QVERIFY(array == array3);
- QVERIFY(array == array4);
-
- array2.append(2.0f);
- QVERIFY(array != array2);
-
- array2.append(1.0f);
- QVERIFY(array != array2);
-
- for (int index = 0; index < 100; ++index)
- array.append(index);
- array2 = array;
- QVERIFY(array2 == array);
- QVERIFY(!(array2 != array));
-}
-
-void tst_QArray::remove()
-{
- QArray<float> array;
-
- array.remove(0, 100);
- QCOMPARE(array.count(), 0);
-
- for (int index = 0; index < 100; ++index)
- array.append(float(index));
-
- array.remove(100, 60);
- QCOMPARE(array.count(), 100);
- array.remove(-60, 60);
-
- array.remove(10, 20);
- QCOMPARE(array.count(), 80);
- for (int index = 0; index < 80; ++index) {
- if (index < 10)
- QCOMPARE(array[index], float(index));
- else
- QCOMPARE(array[index], float(index + 20));
- }
-
- QArray<float> array2(array);
- array2.remove(-10, 20);
- array2.remove(60, 20);
- QCOMPARE(array2.count(), 60);
- for (int index = 0; index < 60; ++index) {
- QCOMPARE(array2[index], float(index + 30));
- }
-
- array.remove(0, 10);
- QCOMPARE(array.count(), 70);
- for (int index = 0; index < 70; ++index) {
- QCOMPARE(array[index], float(index + 30));
- }
-
- // Remove everything and check that it returns to preallocation.
- array.remove(0, array.size());
- QCOMPARE(array.count(), 0);
- QCOMPARE(array.capacity(), ExpectedMinCapacity);
-
- for (int index = 0; index < 100; ++index)
- array.append(float(index));
- array.erase(array.end() - 1);
- QCOMPARE(array.size(), 99);
- array.erase(array.begin(), array.end());
- QCOMPARE(array.count(), 0);
-}
-
-void tst_QArray::removeFirstLast()
-{
- QArray<float> array;
-
- array.removeFirst();
- QVERIFY(array.isEmpty());
- array.removeLast();
- QVERIFY(array.isEmpty());
-
- for (int index = 0; index < 100; ++index)
- array.append(float(index));
-
- array.removeFirst();
- QCOMPARE(array.size(), 99);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array[index], float(index + 1));
-
- array.removeLast();
- QCOMPARE(array.size(), 98);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array[index], float(index + 1));
-}
-
-void tst_QArray::extend()
-{
- QArray<float> array;
-
- float *ptr = array.extend(4);
- ptr[0] = 1.0f;
- ptr[1] = 2.0f;
- ptr[2] = 3.0f;
- ptr[3] = 4.0f;
- QCOMPARE(array.size(), 4);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
-
- array.append(5.0f);
- ptr = array.extend(1);
- ptr[0] = 6.0f;
- QCOMPARE(array.size(), 6);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
- QCOMPARE(array[4], 5.0f);
- QCOMPARE(array[5], 6.0f);
-
- QArray<float> array2(array);
-
- ptr = array.extend(1);
- ptr[0] = 7.0f;
- QCOMPARE(array.size(), 7);
- QCOMPARE(array[0], 1.0f);
- QCOMPARE(array[1], 2.0f);
- QCOMPARE(array[2], 3.0f);
- QCOMPARE(array[3], 4.0f);
- QCOMPARE(array[4], 5.0f);
- QCOMPARE(array[5], 6.0f);
- QCOMPARE(array[6], 7.0f);
-
- QCOMPARE(array2.size(), 6);
-}
-
-void tst_QArray::reverse()
-{
- QArray<float> array0;
-
- // null case
- array0.reverse();
- QCOMPARE(array0.size(), 0);
-
- // basic case
- float *ptr = array0.extend(1);
- ptr[0] = 1.0f;
- array0.reverse();
- QCOMPARE(array0.size(), 1);
- QCOMPARE(array0.at(0), 1.0f);
-
- // odd numbered size
- QArray<float> array1;
- ptr = array1.extend(5);
- ptr[0] = 1.0f;
- ptr[1] = 2.0f;
- ptr[2] = 3.0f;
- ptr[3] = 4.0f;
- ptr[4] = 5.0f;
- array1.reverse();
- QCOMPARE(array1.size(), 5);
- QCOMPARE(array1.at(0), 5.0f);
- QCOMPARE(array1.at(2), 3.0f);
- QCOMPARE(array1.at(4), 1.0f);
-
- // even numbered size
- QArray<float> array2;
- ptr = array2.extend(6);
- ptr[0] = 1.0f;
- ptr[1] = 2.0f;
- ptr[2] = 3.0f;
- ptr[3] = 4.0f;
- ptr[4] = 5.0f;
- ptr[5] = 6.0f;
- array2.reverse();
- QCOMPARE(array2.size(), 6);
- QCOMPARE(array2.at(0), 6.0f);
- QCOMPARE(array2.at(2), 4.0f);
- QCOMPARE(array2.at(3), 3.0f);
- QCOMPARE(array2.at(5), 1.0f);
-
- // complex type
- QVERIFY(QTypeInfo<QString>::isComplex);
- QArray<QString> array3(6, QLatin1String("test"));
- array3[0] = QLatin1String("zero");
- array3[1] = QLatin1String("one");
- array3[2] = QLatin1String("two");
- array3[3] = QLatin1String("three");
- array3[4] = QLatin1String("four");
- array3[5] = QLatin1String("five");
- array3.reverse();
- QCOMPARE(array3.size(), 6);
- QCOMPARE(array3.at(0), QLatin1String("five"));
- QCOMPARE(array3.at(2), QLatin1String("three"));
- QCOMPARE(array3.at(3), QLatin1String("two"));
- QCOMPARE(array3.at(5), QLatin1String("zero"));
-}
-
-void tst_QArray::reversed()
-{
- QArray<float> array0;
-
- // null case
- QArray<float> res0 = array0.reversed();
- QCOMPARE(res0.size(), 0);
-
- // basic case
- float *ptr = array0.extend(1);
- ptr[0] = 1.0f;
- res0 = array0.reversed();
- QCOMPARE(res0.size(), 1);
- QCOMPARE(res0.at(0), 1.0f);
-
- // odd numbered size
- QArray<float> array1;
- ptr = array1.extend(5);
- ptr[0] = 1.0f;
- ptr[1] = 2.0f;
- ptr[2] = 3.0f;
- ptr[3] = 4.0f;
- ptr[4] = 5.0f;
- QArray<float> res1 = array1.reversed();
- QCOMPARE(res1.size(), 5);
- QCOMPARE(res1.at(0), 5.0f);
- QCOMPARE(res1.at(2), 3.0f);
- QCOMPARE(res1.at(4), 1.0f);
-
- // even numbered size
- QArray<float> array2;
- ptr = array2.extend(6);
- ptr[0] = 1.0f;
- ptr[1] = 2.0f;
- ptr[2] = 3.0f;
- ptr[3] = 4.0f;
- ptr[4] = 5.0f;
- ptr[5] = 6.0f;
- QArray<float> res2 = array2.reversed();
- QCOMPARE(res2.size(), 6);
- QCOMPARE(res2.at(0), 6.0f);
- QCOMPARE(res2.at(2), 4.0f);
- QCOMPARE(res2.at(3), 3.0f);
- QCOMPARE(res2.at(5), 1.0f);
-
- // simple type with larger size
- QArray<QVector3D> array4;
- array4.extend(6);
- QVector3D va(1.0f, 2.0f, 3.0f);
- QVector3D vb(11.0f, 12.0f, 13.0f);
- QVector3D vc(21.0f, 22.0f, 23.0f);
- QVector3D vd(31.0f, 32.0f, 33.0f);
- QVector3D ve(41.0f, 42.0f, 43.0f);
- QVector3D vf(51.0f, 52.0f, 53.0f);
- array4[0] = va;
- array4[1] = vb;
- array4[2] = vc;
- array4[3] = vd;
- array4[4] = ve;
- array4[5] = vf;
- QArray<QVector3D> res4 = array4.reversed();
- QCOMPARE(res4.size(), 6);
- QCOMPARE(res4.at(0), vf);
- QCOMPARE(res4.at(2), vd);
- QCOMPARE(res4.at(3), vc);
- QCOMPARE(res4.at(5), va);
-}
-
-void tst_QArray::mid()
-{
- QArray<float> array;
- for (int index = 0; index < 1024; ++index)
- array.append(float(index));
-
- QArray<float> mid = array.mid(0);
- QCOMPARE(mid.size(), array.size());
- QVERIFY(!mid.isEmpty());
- QVERIFY(mid.constData() == array.constData());
- for (int index = 0; index < 1024; ++index) {
- QCOMPARE(mid.at(index), float(index));
- QCOMPARE(mid[index], float(index));
- }
-
- mid = array.mid(500, 20);
- QCOMPARE(mid.size(), 20);
- QVERIFY(!mid.isEmpty());
- for (int index = 0; index < 20; ++index) {
- QCOMPARE(mid.at(index), float(index + 500));
- QCOMPARE(mid[index], float(index + 500));
- }
-
- QArray<float> mid2 = array.mid(500, 20);
- QVERIFY(mid == mid2);
- QVERIFY(!(mid != mid2));
-
- QArray<float> mid3 = array.mid(500, 21);
- QVERIFY(mid != mid3);
- QVERIFY(!(mid == mid3));
-
- QArray<float> mid4 = array.mid(400, 20);
- QVERIFY(mid != mid4);
- QVERIFY(!(mid == mid4));
-
- QArray<float> mid5;
- QArray<float> mid6;
- QVERIFY(mid != mid5);
- QVERIFY(!(mid == mid5));
- QVERIFY(mid5 != mid);
- QVERIFY(!(mid5 == mid));
- QVERIFY(mid5 == mid6);
- QVERIFY(!(mid5 != mid6));
-
- mid = array.mid(500, 0);
- QCOMPARE(mid.size(), 0);
- QVERIFY(mid.isEmpty());
-
- mid = array.mid(1000, 30);
- QCOMPARE(mid.size(), 24);
- QVERIFY(!mid.isEmpty());
- for (int index = 0; index < 24; ++index) {
- QCOMPARE(mid.at(index), float(index + 1000));
- QCOMPARE(mid[index], float(index + 1000));
- }
-}
-
-void tst_QArray::left()
-{
- QArray<float> array;
- for (int index = 0; index < 1024; ++index)
- array.append(float(index));
-
- QArray<float> left = array.left(-1);
- QVERIFY(left == array);
-
- left = array.left(0);
- QVERIFY(left.isEmpty());
-
- left = array.left(500);
- QCOMPARE(left.size(), 500);
- QVERIFY(left == array.mid(0, 500));
-
- left = array.left(2048);
- QVERIFY(left == array);
-}
-
-void tst_QArray::right()
-{
- QArray<float> array;
- for (int index = 0; index < 1024; ++index)
- array.append(float(index));
-
- QArray<float> right = array.right(-1);
- QVERIFY(right == array);
-
- right = array.right(0);
- QVERIFY(right.isEmpty());
-
- right = array.right(500);
- QCOMPARE(right.size(), 500);
- QVERIFY(right == array.mid(1024 - 500, 500));
-
- right = array.right(2048);
- QVERIFY(right == array);
-}
-
-void tst_QArray::iterate()
-{
- QArray<float> array;
- for (int index = 0; index < 1024; ++index)
- array.append(float(index));
-
- QArray<float>::Iterator it1;
- int value = 0;
- for (it1 = array.begin(); it1 != array.end(); ++it1)
- QCOMPARE(*it1, float(value++));
- QCOMPARE(value, array.size());
-
- QArray<float>::ConstIterator it2;
- value = 0;
- for (it2 = array.constBegin(); it2 != array.constEnd(); ++it2)
- QCOMPARE(*it2, float(value++));
- QCOMPARE(value, array.size());
-
- value = 0;
- for (it1 = array.begin(); it1 != array.end(); ++it1)
- *it1 = float(1024 - value++);
- value = 0;
- for (it2 = array.constBegin(); it2 != array.constEnd(); ++it2) {
- QCOMPARE(*it2, float(1024 - value));
- QCOMPARE(array[value], float(1024 - value));
- ++value;
- }
-
- for (int index = 0; index < 1024; ++index)
- array[index] = float(index);
-}
-
-// Verify that when the data is in the preallocated section, it is
-// copied across and the original constData() pointer remains the same.
-void tst_QArray::copyPrealloc()
-{
- QArray<float> array1;
- array1.append(1.0f);
- array1.append(2.0f);
-
- const float *data = array1.constData();
-
- QArray<float> array2(array1);
-
- QVERIFY(array1.constData() == data);
- QVERIFY(array2.constData() != data);
-
- QCOMPARE(array2.size(), 2);
- QCOMPARE(array2[0], float(1.0f));
- QCOMPARE(array2[1], float(2.0f));
-
- QArray<float> array3;
- QCOMPARE(array3.size(), 0);
- array3 = array1;
-
- QVERIFY(array1.constData() == data);
- QVERIFY(array3.constData() != data);
-
- QCOMPARE(array3.size(), 2);
- QCOMPARE(array3[0], float(1.0f));
- QCOMPARE(array3[1], float(2.0f));
-}
-
-void tst_QArray::insert()
-{
- QArray<float> array;
- for (int index = 0; index < 10; ++index)
- array.append(float(index));
-
- array.prepend(-1.0f);
- QCOMPARE(array.size(), 11);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array[index], float(index - 1));
-
- array.insert(array.size(), 10.0f);
- QCOMPARE(array.size(), 12);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array[index], float(index - 1));
-
- array.insert(1, 0.5f);
- QCOMPARE(array.size(), 13);
- QCOMPARE(array[0], -1.0f);
- QCOMPARE(array[1], 0.5f);
- QCOMPARE(array[2], 0.0f);
- QCOMPARE(array[12], 10.0f);
-
- array.insert(10, 0, 7.5f);
- array.insert(10, 4, 7.5f);
- QCOMPARE(array.size(), 17);
- QCOMPARE(array[9], 7.0f);
- QCOMPARE(array[10], 7.5f);
- QCOMPARE(array[11], 7.5f);
- QCOMPARE(array[12], 7.5f);
- QCOMPARE(array[13], 7.5f);
- QCOMPARE(array[14], 8.0f);
- QCOMPARE(array[15], 9.0f);
- QCOMPARE(array[16], 10.0f);
-
- // Repeat the tests with QString
- QArray<QString> array2;
- for (int index = 0; index < 10; ++index)
- array2.append(QString::number(index));
-
- array2.prepend(QString::number(-1));
- QCOMPARE(array2.size(), 11);
- for (int index = 0; index < array2.size(); ++index)
- QCOMPARE(array2[index], QString::number(index - 1));
-
- array2.insert(array2.size(), QString::number(10));
- QCOMPARE(array2.size(), 12);
- for (int index = 0; index < array2.size(); ++index)
- QCOMPARE(array2[index], QString::number(index - 1));
-
- array2.insert(1, QString::number(5));
- QCOMPARE(array2.size(), 13);
- QCOMPARE(array2[0], QString::number(-1));
- QCOMPARE(array2[1], QString::number(5));
- QCOMPARE(array2[2], QString::number(0));
- QCOMPARE(array2[12], QString::number(10));
-
- array2.insert(10, 4, QString::number(3));
- QCOMPARE(array2.size(), 17);
- QCOMPARE(array2[9], QString::number(7));
- QCOMPARE(array2[10], QString::number(3));
- QCOMPARE(array2[11], QString::number(3));
- QCOMPARE(array2[12], QString::number(3));
- QCOMPARE(array2[13], QString::number(3));
- QCOMPARE(array2[14], QString::number(8));
- QCOMPARE(array2[15], QString::number(9));
- QCOMPARE(array2[16], QString::number(10));
-
- // Repeat the tests with ComplexValue
- QArray<ComplexValue> array3;
- for (int index = 0; index < 10; ++index)
- array3.append(ComplexValue(index));
-
- array3.prepend(ComplexValue(-1));
- ComplexValue::destroyCount = 0;
- QCOMPARE(array3.size(), 11);
- for (int index = 0; index < array3.size(); ++index) {
- QVERIFY(array3[index] == (index - 1));
- QVERIFY(array3[index].mode() == ComplexValue::Assign);
- }
- QCOMPARE(ComplexValue::destroyCount, 0);
-
- array3.insert(array3.size(), ComplexValue(10));
- QCOMPARE(array3.size(), 12);
- for (int index = 0; index < array3.size(); ++index)
- QVERIFY(array3[index] == (index - 1));
-
- array3.insert(1, ComplexValue(5));
- QCOMPARE(array3.size(), 13);
- QVERIFY(array3[0] == -1);
- QVERIFY(array3[1] == 5);
- QVERIFY(array3[2] == 0);
- QVERIFY(array3[12] == 10);
-
- array3.insert(10, 4, ComplexValue(3));
- QCOMPARE(array3.size(), 17);
- QVERIFY(array3[9] == 7);
- QVERIFY(array3[10] == 3);
- QVERIFY(array3[11] == 3);
- QVERIFY(array3[12] == 3);
- QVERIFY(array3[13] == 3);
- QVERIFY(array3[14] == 8);
- QVERIFY(array3[15] == 9);
- QVERIFY(array3[16] == 10);
-}
-
-void tst_QArray::fromRawData()
-{
- QArray<float> array;
- float contents[] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
- 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f};
-
- array = QArray<float>::fromRawData(contents, 0);
- QCOMPARE(array.size(), 0);
- QCOMPARE(array.capacity(), 0);
- QVERIFY(!array.isDetached());
- array.append(1.0f);
- QCOMPARE(array.size(), 1);
- QVERIFY(array.capacity() > 0);
- QCOMPARE(array.at(0), 1.0f);
- QVERIFY(array.isDetached());
-
- array = QArray<float>::fromRawData(contents, 6);
- QCOMPARE(array.size(), 6);
- QCOMPARE(array.capacity(), 6);
- for (int index = 0; index < 6; ++index)
- QCOMPARE(array.at(index), contents[index]);
- QVERIFY(array.constData() == contents);
- QVERIFY(!array.isDetached());
-
- // Force a copy-on-write.
- array[3] = 42.0f;
- QVERIFY(array.isDetached());
- QCOMPARE(contents[3], 4.0f);
- QCOMPARE(array.size(), 6);
- QVERIFY(array.capacity() > 6);
- for (int index = 0; index < 6; ++index) {
- if (index != 3)
- QCOMPARE(array.at(index), contents[index]);
- else
- QCOMPARE(array.at(index), 42.0f);
- }
- QVERIFY(array.constData() != contents);
-
- array = QArray<float>::fromRawData(contents, 12);
- QCOMPARE(array.size(), 12);
- QCOMPARE(array.capacity(), 12);
- for (int index = 0; index < 12; ++index)
- QCOMPARE(array.at(index), contents[index]);
- QVERIFY(array.constData() == contents);
-
- QString strings[] = {QLatin1String("foo"), QLatin1String("bar")};
- QArray<QString> array2;
- array2 = QArray<QString>::fromRawData(strings, 2);
- QCOMPARE(array2.size(), 2);
- QCOMPARE(array2.capacity(), 2);
- QCOMPARE(array2.at(0), QLatin1String("foo"));
- QCOMPARE(array2.at(1), QLatin1String("bar"));
- QVERIFY(array2.constData() == strings);
-
- // Force a copy-on-write.
- array2[1] = QLatin1String("baz");
- QCOMPARE(array2.size(), 2);
- QVERIFY(array2.capacity() > 2);
- QCOMPARE(array2.at(0), QLatin1String("foo"));
- QCOMPARE(array2.at(1), QLatin1String("baz"));
- QVERIFY(array2.constData() != strings);
- QCOMPARE(strings[0], QLatin1String("foo"));
- QCOMPARE(strings[1], QLatin1String("bar"));
-}
-
-void tst_QArray::fromWritableRawData()
-{
- QArray<float> array;
- float contents[] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
- float contentsModified[] =
- {1.0f, 2.0f, 3.0f, 42.0f, 5.0f, 6.0f, 53.0f};
-
- array = QArray<float>::fromWritableRawData(contents, 0);
- QCOMPARE(array.size(), 0);
- QCOMPARE(array.capacity(), 0);
- array.append(0.0f);
- QCOMPARE(array.size(), 1);
- QVERIFY(array.capacity() > 0);
- QCOMPARE(array.at(0), 0.0f);
-
- array = QArray<float>::fromWritableRawData(contents, 6);
- QCOMPARE(array.size(), 6);
- QCOMPARE(array.capacity(), 6);
- for (int index = 0; index < 6; ++index)
- QCOMPARE(array.at(index), contents[index]);
- QVERIFY(array.constData() == contents);
-
- // Modify the raw data in-place.
- array[3] = 42.0f;
- QVERIFY(array.constData() == contents);
-
- // Force a copy.
- array.append(53.0f);
- QVERIFY(array.constData() != contents);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array.at(index), contentsModified[index]);
-
- // Resize to smaller should stay within the raw data.
- array = QArray<float>::fromWritableRawData(contents, 6);
- array.resize(6);
- QCOMPARE(array.size(), 6);
- array.resize(5);
- QCOMPARE(array.size(), 5);
- QVERIFY(array.constData() == contents);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array.at(index), contentsModified[index]);
- array.append(6.0f);
- QVERIFY(array.constData() == contents);
- for (int index = 0; index < array.size(); ++index)
- QCOMPARE(array.at(index), contentsModified[index]);
-
- // Resize to larger should force a copy.
- array = QArray<float>::fromWritableRawData(contents, 6);
- array.resize(7);
- QVERIFY(array.constData() != contents);
- for (int index = 0; index < 6; ++index)
- QCOMPARE(array.at(index), contentsModified[index]);
- QCOMPARE(array.at(6), 0.0f);
-
- // Reserve to a larger size should force a copy.
- array = QArray<float>::fromWritableRawData(contents, 6);
- array.reserve(7);
- QCOMPARE(array.size(), 6);
- QVERIFY(array.capacity() >= 7);
- QVERIFY(array.constData() != contents);
- for (int index = 0; index < 6; ++index)
- QCOMPARE(array.at(index), contentsModified[index]);
-}
-
-void tst_QArray::search()
-{
- QArray<float> array;
- for (int index = 0; index < 1000; ++index)
- array.append(float(index));
-
- QCOMPARE(array.indexOf(0.0f), 0);
- QCOMPARE(array.indexOf(10.0f), 10);
- QCOMPARE(array.indexOf(999.0f), 999);
- QCOMPARE(array.indexOf(1000.0f), -1);
- QCOMPARE(array.indexOf(10.0f, 9), 10);
- QCOMPARE(array.indexOf(10.0f, 10), 10);
- QCOMPARE(array.indexOf(10.0f, 11), -1);
- QCOMPARE(array.indexOf(999.0f, -1), 999);
- QCOMPARE(array.indexOf(998.0f, -1), -1);
- QCOMPARE(array.indexOf(998.0f, -2), 998);
- QCOMPARE(array.indexOf(998.0f, -3), 998);
- QCOMPARE(array.indexOf(998.0f, -2000), 998);
- QCOMPARE(array.indexOf(998.0f, 2000), -1);
-
- QCOMPARE(array.lastIndexOf(0.0f), 0);
- QCOMPARE(array.lastIndexOf(10.0f), 10);
- QCOMPARE(array.lastIndexOf(999.0f), 999);
- QCOMPARE(array.lastIndexOf(1000.0f), -1);
- QCOMPARE(array.lastIndexOf(10.0f, 9), -1);
- QCOMPARE(array.lastIndexOf(10.0f, 10), 10);
- QCOMPARE(array.lastIndexOf(10.0f, 11), 10);
- QCOMPARE(array.lastIndexOf(999.0f, -1), 999);
- QCOMPARE(array.lastIndexOf(998.0f, -1), 998);
- QCOMPARE(array.lastIndexOf(998.0f, -2), 998);
- QCOMPARE(array.lastIndexOf(998.0f, -3), -1);
- QCOMPARE(array.lastIndexOf(998.0f, -2000), -1);
- QCOMPARE(array.lastIndexOf(998.0f, 2000), 998);
-
- QVERIFY(array.contains(0.0f));
- QVERIFY(array.contains(10.0f));
- QVERIFY(array.contains(999.0f));
- QVERIFY(!array.contains(1000.0f));
- QVERIFY(!array.contains(-1.0f));
-
- array.append(500.0f);
- QCOMPARE(array.count(0.0f), 1);
- QCOMPARE(array.count(10.0f), 1);
- QCOMPARE(array.count(500.0f), 2);
- QCOMPARE(array.count(999.0f), 1);
- QCOMPARE(array.count(1000.0f), 0);
-
- QVERIFY(array.startsWith(0.0f));
- QVERIFY(!array.startsWith(1.0f));
-
- QVERIFY(array.endsWith(500.0f));
- QVERIFY(!array.endsWith(1.0f));
-
- QCOMPARE(array.first(), 0.0f);
- QCOMPARE(array.last(), 500.0f);
-}
-
-void tst_QArray::fill()
-{
- QArray<float> array;
- array.fill(1.0f);
- QCOMPARE(array.size(), 0);
-
- array.fill(1.0f, 100);
- QCOMPARE(array.size(), 100);
- for (int index = 0; index < 100; ++index)
- QCOMPARE(array.at(index), 1.0f);
-
- array.fill(2.0f);
- QCOMPARE(array.size(), 100);
- for (int index = 0; index < 100; ++index)
- QCOMPARE(array.at(index), 2.0f);
-
- array.fill(3.0f, 20);
- QCOMPARE(array.size(), 20);
- for (int index = 0; index < 20; ++index)
- QCOMPARE(array.at(index), 3.0f);
-}
-
-void tst_QArray::zeroPrealloc()
-{
- // Check that the zero-prealloc case actually uses less memory
- // by optimizing away the m_prealloc structure.
- QArray<float, 0> array;
- QArray<float, 1> array2;
- QVERIFY(sizeof(array) < sizeof(array2));
-
- // Check that zero-prealloc arrays act properly by expanding the
- // template on functions that involve preallocation operations.
- QVERIFY(array.isEmpty());
- QCOMPARE(array.size(), 0);
- QCOMPARE(array.capacity(), 0);
- QVERIFY(!array.constData()); // Will be null for PreallocSize == 0.
- array.append(1.0f);
- QCOMPARE(array.size(), 1);
- QCOMPARE(array[0], 1.0f);
- QArray<float, 0> array3(array);
- QVERIFY(array.constData() == array3.constData());
-
- QArray<float, 0> array4(100, 3.0f);
- QCOMPARE(array4.size(), 100);
- for (int index = 0; index < 100; ++index)
- QCOMPARE(array4[index], 3.0f);
- array4.clear();
- QCOMPARE(array4.size(), 0);
-}
-
-void tst_QArray::exceptions()
-{
-#ifndef QT_NO_EXCEPTIONS
-
- // Check that an exception thrown during append() will leave
- // the array in the pre-append state.
- QArray<ComplexValue> array;
- try {
- array.append(ComplexValue(42, ComplexValue::ThrowOnCopy));
- QFAIL("should not be able to append - A");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 0);
- }
- try {
- array.append(ComplexValue(42, ComplexValue::ThrowOnCopy), ComplexValue(24));
- QFAIL("should not be able to append - B");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 0);
- }
- try {
- array.append(ComplexValue(24), ComplexValue(42, ComplexValue::ThrowOnCopy));
- QFAIL("should not be able to append - C");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 1);
- QCOMPARE(array.at(0).value(), 24);
- }
- array.clear();
- try {
- array.append(ComplexValue(42, ComplexValue::ThrowOnCopy),
- ComplexValue(24),
- ComplexValue(16));
- QFAIL("should not be able to append - D");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 0);
- }
- try {
- array.append(ComplexValue(24),
- ComplexValue(42, ComplexValue::ThrowOnCopy),
- ComplexValue(16));
- QFAIL("should not be able to append - E");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 1);
- QCOMPARE(array.at(0).value(), 24);
- }
- array.clear();
- try {
- array.append(ComplexValue(24),
- ComplexValue(16),
- ComplexValue(42, ComplexValue::ThrowOnCopy));
- QFAIL("should not be able to append - F");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 2);
- QCOMPARE(array.at(0).value(), 24);
- QCOMPARE(array.at(1).value(), 16);
- }
- array.clear();
- try {
- array.append(ComplexValue(42, ComplexValue::ThrowOnCopy),
- ComplexValue(24),
- ComplexValue(82),
- ComplexValue(16));
- QFAIL("should not be able to append - G");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 0);
- }
- try {
- array.append(ComplexValue(24),
- ComplexValue(42, ComplexValue::ThrowOnCopy),
- ComplexValue(82),
- ComplexValue(16));
- QFAIL("should not be able to append - H");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 1);
- QCOMPARE(array.at(0).value(), 24);
- }
- array.clear();
- try {
- array.append(ComplexValue(24),
- ComplexValue(16),
- ComplexValue(42, ComplexValue::ThrowOnCopy),
- ComplexValue(82));
- QFAIL("should not be able to append - I");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 2);
- QCOMPARE(array.at(0).value(), 24);
- QCOMPARE(array.at(1).value(), 16);
- }
- array.clear();
- try {
- array.append(ComplexValue(24),
- ComplexValue(16),
- ComplexValue(82),
- ComplexValue(42, ComplexValue::ThrowOnCopy));
- QFAIL("should not be able to append - J");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 3);
- QCOMPARE(array.at(0).value(), 24);
- QCOMPARE(array.at(1).value(), 16);
- QCOMPARE(array.at(2).value(), 82);
- }
- array.clear();
- ComplexValue values[] = {
- ComplexValue(1),
- ComplexValue(2),
- ComplexValue(3, ComplexValue::ThrowOnCopy)
- };
- try {
- array.append(values, 3);
- QFAIL("should not be able to append - K");
- } catch (ComplexValueException *e) {
- delete e;
- QCOMPARE(array.size(), 2);
- QCOMPARE(array.at(0).value(), 1);
- QCOMPARE(array.at(1).value(), 2);
- }
-
-#endif
-}
-
-void tst_QArray::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QArray<float> array;
- for (int index = 0; index < 1024; ++index)
- array.append(float(index));
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << array;
- }
-
- QArray<float> array2;
- {
- QDataStream stream2(data);
- stream2 >> array2;
- }
-
- QVERIFY(array == array2);
-#endif
-}
-
-QTEST_APPLESS_MAIN(tst_QArray)
-
-#include "tst_qarray.moc"
diff --git a/tests/auto/threed/qbox3d/qbox3d.pro b/tests/auto/threed/qbox3d/qbox3d.pro
deleted file mode 100644
index b488bd2a..00000000
--- a/tests/auto/threed/qbox3d/qbox3d.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qbox3d
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qbox3d.cpp
diff --git a/tests/auto/threed/qbox3d/tst_qbox3d.cpp b/tests/auto/threed/qbox3d/tst_qbox3d.cpp
deleted file mode 100644
index 65c1cd44..00000000
--- a/tests/auto/threed/qbox3d/tst_qbox3d.cpp
+++ /dev/null
@@ -1,1302 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qbox3d.h"
-#include <QtGui/qmatrix4x4.h>
-
-class tst_QBox3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QBox3D() {}
- ~tst_QBox3D() {}
-
-private slots:
- void create();
- void modify();
- void compare();
- void fuzzyCompare();
- void size_data();
- void size();
- void center_data();
- void center();
- void containsPoint_data();
- void containsPoint();
- void containsBox_data();
- void containsBox();
- void intersects_data();
- void intersects();
- void intersect_data();
- void intersect();
- void intersected_data();
- void intersected();
- void intersectRay_data();
- void intersectRay();
- void unitePoint_data();
- void unitePoint();
- void uniteBox_data();
- void uniteBox();
- void unitedPoint_data();
- void unitedPoint();
- void unitedBox_data();
- void unitedBox();
- void transform();
- void transformed();
- void dataStream();
- void properties();
- void metaTypes();
-};
-
-void tst_QBox3D::create()
-{
- QBox3D box1;
- QVERIFY(box1.isNull());
- QVERIFY(!box1.isFinite());
- QVERIFY(!box1.isInfinite());
- QVERIFY(box1.minimum() == QVector3D(0, 0, 0));
- QVERIFY(box1.maximum() == QVector3D(0, 0, 0));
-
- QBox3D box2;
- box2.setToInfinite();
- QVERIFY(!box2.isNull());
- QVERIFY(!box2.isFinite());
- QVERIFY(box2.isInfinite());
- QVERIFY(box2.minimum() == QVector3D(0, 0, 0));
- QVERIFY(box2.maximum() == QVector3D(0, 0, 0));
-
- QBox3D box3(QVector3D(1, 2, 3), QVector3D(4, 5, 6));
- QVERIFY(!box3.isNull());
- QVERIFY(box3.isFinite());
- QVERIFY(!box3.isInfinite());
- QVERIFY(box3.minimum() == QVector3D(1, 2, 3));
- QVERIFY(box3.maximum() == QVector3D(4, 5, 6));
-
- QBox3D box4(QVector3D(4, 5, 6), QVector3D(1, 2, 3));
- QVERIFY(!box4.isNull());
- QVERIFY(box4.isFinite());
- QVERIFY(!box4.isInfinite());
- QVERIFY(box4.minimum() == QVector3D(1, 2, 3));
- QVERIFY(box4.maximum() == QVector3D(4, 5, 6));
-
- QBox3D box5(box4);
- QVERIFY(!box5.isNull());
- QVERIFY(box5.isFinite());
- QVERIFY(!box5.isInfinite());
- QVERIFY(box5.minimum() == QVector3D(1, 2, 3));
- QVERIFY(box5.maximum() == QVector3D(4, 5, 6));
-
- box5 = box2;
- QVERIFY(!box5.isNull());
- QVERIFY(!box5.isFinite());
- QVERIFY(box5.isInfinite());
- QVERIFY(box5.minimum() == QVector3D(0, 0, 0));
- QVERIFY(box5.maximum() == QVector3D(0, 0, 0));
-}
-
-void tst_QBox3D::modify()
-{
- // Use setExtents, which will swap minimum and maximum.
- QBox3D box;
- box.setExtents(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QVERIFY(!box.isNull());
- QVERIFY(box.isFinite());
- QVERIFY(!box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(-5, -6, -7));
- QVERIFY(box.maximum() == QVector3D(-1, -2, -3));
-
- box.setExtents(QVector3D(1, 2, 3), QVector3D(4, 5, 6));
- QVERIFY(!box.isNull());
- QVERIFY(box.isFinite());
- QVERIFY(!box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(1, 2, 3));
- QVERIFY(box.maximum() == QVector3D(4, 5, 6));
-
- box.setToNull();
- QVERIFY(box.isNull());
- QVERIFY(!box.isFinite());
- QVERIFY(!box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(0, 0, 0));
- QVERIFY(box.maximum() == QVector3D(0, 0, 0));
-
- // Using setExtents will turn a null box into a finite box.
- box.setExtents(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QVERIFY(!box.isNull());
- QVERIFY(box.isFinite());
- QVERIFY(!box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(-5, -6, -7));
- QVERIFY(box.maximum() == QVector3D(-1, -2, -3));
-
- box.setToInfinite();
- QVERIFY(!box.isNull());
- QVERIFY(!box.isFinite());
- QVERIFY(box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(0, 0, 0));
- QVERIFY(box.maximum() == QVector3D(0, 0, 0));
-
- // Using setExtents will turn an infinite box into a finite box.
- box.setExtents(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QVERIFY(!box.isNull());
- QVERIFY(box.isFinite());
- QVERIFY(!box.isInfinite());
- QVERIFY(box.minimum() == QVector3D(-5, -6, -7));
- QVERIFY(box.maximum() == QVector3D(-1, -2, -3));
-}
-
-void tst_QBox3D::compare()
-{
- QBox3D box1(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QBox3D box2(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QBox3D box3(QVector3D(0, -2, -3), QVector3D(-5, -6, -7));
- QBox3D null1, null2;
- QBox3D infinite1, infinite2;
- infinite1.setToInfinite();
- infinite2.setToInfinite();
-
- QVERIFY(box1 == box2);
- QVERIFY(box1 != box3);
- QVERIFY(box1 != null1);
- QVERIFY(box1 != infinite1);
-
- QVERIFY(null1 == null2);
- QVERIFY(null1 != box1);
- QVERIFY(null1 != infinite1);
-
- QVERIFY(infinite1 == infinite2);
- QVERIFY(infinite1 != box1);
- QVERIFY(infinite1 != null1);
-}
-
-void tst_QBox3D::fuzzyCompare()
-{
- QBox3D box1(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QBox3D box2(QVector3D(-1, -2, -3), QVector3D(-5, -6, -7));
- QBox3D box3(QVector3D(0, -2, -3), QVector3D(-5, -6, -7));
- QBox3D null1, null2;
- QBox3D infinite1, infinite2;
- infinite1.setToInfinite();
- infinite2.setToInfinite();
-
- QVERIFY(qFuzzyCompare(box1, box2));
- QVERIFY(!qFuzzyCompare(box1, box3));
- QVERIFY(!qFuzzyCompare(box1, null1));
- QVERIFY(!qFuzzyCompare(box1, infinite1));
-
- QVERIFY(qFuzzyCompare(null1, null2));
- QVERIFY(!qFuzzyCompare(null1, box1));
- QVERIFY(!qFuzzyCompare(null1, infinite1));
-
- QVERIFY(qFuzzyCompare(infinite1, infinite2));
- QVERIFY(!qFuzzyCompare(infinite1, box1));
- QVERIFY(!qFuzzyCompare(infinite1, null1));
-}
-
-void tst_QBox3D::size_data()
-{
- QTest::addColumn<qreal>("x1");
- QTest::addColumn<qreal>("y1");
- QTest::addColumn<qreal>("z1");
- QTest::addColumn<qreal>("x2");
- QTest::addColumn<qreal>("y2");
- QTest::addColumn<qreal>("z2");
-
- QTest::newRow("zero")
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0;
-
- QTest::newRow("one")
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)1.0 << (qreal)1.0 << (qreal)1.0;
-
- QTest::newRow("empty")
- << (qreal)1.0 << (qreal)1.0 << (qreal)1.0
- << (qreal)1.0 << (qreal)1.0 << (qreal)1.0;
-
- QTest::newRow("complex")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)4.0 << (qreal)5.0 << (qreal)6.0;
-}
-void tst_QBox3D::size()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
-
- qreal sizex = (x1 < x2) ? (x2 - x1) : (x1 - x2);
- qreal sizey = (y1 < y2) ? (y2 - y1) : (y1 - y2);
- qreal sizez = (z1 < z2) ? (z2 - z1) : (z1 - z2);
-
- QBox3D box(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QVERIFY(box.size() == QVector3D(sizex, sizey, sizez));
-
- box.setToNull();
- QVERIFY(box.size() == QVector3D(0, 0, 0));
-
- box.setToInfinite();
- QVERIFY(box.size() == QVector3D(0, 0, 0));
-}
-
-void tst_QBox3D::center_data()
-{
- // Use the same test data as the size tests.
- size_data();
-}
-void tst_QBox3D::center()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
-
- qreal centerx = (x1 + x2) / 2;
- qreal centery = (y1 + y2) / 2;
- qreal centerz = (z1 + z2) / 2;
-
- QBox3D box(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QVERIFY(box.center() == QVector3D(centerx, centery, centerz));
-
- box.setToNull();
- QVERIFY(box.center() == QVector3D(0, 0, 0));
-
- box.setToInfinite();
- QVERIFY(box.center() == QVector3D(0, 0, 0));
-}
-
-void tst_QBox3D::containsPoint_data()
-{
- QTest::addColumn<qreal>("x");
- QTest::addColumn<qreal>("y");
- QTest::addColumn<qreal>("z");
- QTest::addColumn<bool>("contained");
-
- QTest::newRow("zero")
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0 << true;
-
- QTest::newRow("boundary1")
- << (qreal)-1 << (qreal)-2 << (qreal)-3 << true;
- QTest::newRow("boundary2")
- << (qreal)-1 << (qreal)5 << (qreal)-3 << true;
- QTest::newRow("boundary3")
- << (qreal)-1 << (qreal)-2 << (qreal)6 << true;
- QTest::newRow("boundary4")
- << (qreal)-1 << (qreal)5 << (qreal)6 << true;
- QTest::newRow("boundary5")
- << (qreal)4 << (qreal)-2 << (qreal)-3 << true;
- QTest::newRow("boundary6")
- << (qreal)4 << (qreal)5 << (qreal)-3 << true;
- QTest::newRow("boundary7")
- << (qreal)4 << (qreal)-2 << (qreal)6 << true;
- QTest::newRow("boundary8")
- << (qreal)4 << (qreal)5 << (qreal)6 << true;
-
- QTest::newRow("outside1")
- << (qreal)-2 << (qreal)-2 << (qreal)-3 << false;
- QTest::newRow("outside2")
- << (qreal)-1 << (qreal)6 << (qreal)-3 << false;
- QTest::newRow("outside3")
- << (qreal)-1 << (qreal)-2 << (qreal)7 << false;
- QTest::newRow("outside4")
- << (qreal)-1 << (qreal)-3 << (qreal)6 << false;
- QTest::newRow("outside5")
- << (qreal)5 << (qreal)-2 << (qreal)-3 << false;
- QTest::newRow("outside6")
- << (qreal)4 << (qreal)6 << (qreal)-3 << false;
- QTest::newRow("outside7")
- << (qreal)4 << (qreal)-2 << (qreal)7 << false;
- QTest::newRow("outside8")
- << (qreal)4 << (qreal)-3 << (qreal)6 << false;
-}
-void tst_QBox3D::containsPoint()
-{
- QFETCH(qreal, x);
- QFETCH(qreal, y);
- QFETCH(qreal, z);
- QFETCH(bool, contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(4, 5, 6));
-
- if (contained)
- QVERIFY(box.contains(QVector3D(x, y, z)));
- else
- QVERIFY(!box.contains(QVector3D(x, y, z)));
-
- QBox3D null;
- QVERIFY(!null.contains(QVector3D(x, y, z)));
-
- QBox3D infinite;
- infinite.setToInfinite();
- QVERIFY(infinite.contains(QVector3D(x, y, z)));
-}
-
-void tst_QBox3D::containsBox_data()
-{
- QTest::addColumn<qreal>("x1");
- QTest::addColumn<qreal>("y1");
- QTest::addColumn<qreal>("z1");
- QTest::addColumn<qreal>("x2");
- QTest::addColumn<qreal>("y2");
- QTest::addColumn<qreal>("z2");
- QTest::addColumn<bool>("contained");
- QTest::addColumn<bool>("intersects");
- QTest::addColumn<qreal>("ix1"); // Intersection box
- QTest::addColumn<qreal>("iy1");
- QTest::addColumn<qreal>("iz1");
- QTest::addColumn<qreal>("ix2");
- QTest::addColumn<qreal>("iy2");
- QTest::addColumn<qreal>("iz2");
- QTest::addColumn<qreal>("ex1"); // Expanded box
- QTest::addColumn<qreal>("ey1");
- QTest::addColumn<qreal>("ez1");
- QTest::addColumn<qreal>("ex2");
- QTest::addColumn<qreal>("ey2");
- QTest::addColumn<qreal>("ez2");
-
- QTest::newRow("zero")
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << true << true
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
-
- QTest::newRow("side1")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)-2.0 << (qreal)3.0
- << true << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)-2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("side2")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)-3.0
- << true << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)-3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("side3")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)-1.0 << (qreal)2.0 << (qreal)3.0
- << true << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)-1.0 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("side4")
- << (qreal)-1.0 << (qreal)2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << true << true
- << (qreal)-1.0 << (qreal)2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("side5")
- << (qreal)1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << true << true
- << (qreal)1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("side6")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << true << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
-
- QTest::newRow("outside1")
- << (qreal)-1.0 << (qreal)-2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)-2.5 << (qreal)3.0
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("outside2")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)-3.5
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("outside3")
- << (qreal)-1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)-1.5 << (qreal)2.0 << (qreal)3.0
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("outside4")
- << (qreal)-1.0 << (qreal)2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.5 << (qreal)3.0
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.5 << (qreal)3.0;
- QTest::newRow("outside5")
- << (qreal)1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.5 << (qreal)2.0 << (qreal)3.0
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.5 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("outside6")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.5
- << false << false
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)0.0 << (qreal)0.0 << (qreal)0.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.5;
-
- QTest::newRow("overlap1")
- << (qreal)-1.0 << (qreal)-2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)-1.5 << (qreal)3.0
- << false << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)-1.5 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("overlap2")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)-2.5
- << false << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)-2.5
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("overlap3")
- << (qreal)-1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)-0.5 << (qreal)2.0 << (qreal)3.0
- << false << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)-0.5 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("overlap4")
- << (qreal)-1.0 << (qreal)2.5 << (qreal)-3.0
- << (qreal)1.0 << (qreal)1.5 << (qreal)3.0
- << false << true
- << (qreal)-1.0 << (qreal)2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)1.5 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.5 << (qreal)3.0;
- QTest::newRow("overlap5")
- << (qreal)1.5 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)0.5 << (qreal)2.0 << (qreal)3.0
- << false << true
- << (qreal)1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)0.5 << (qreal)2.0 << (qreal)3.0
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.5 << (qreal)2.0 << (qreal)3.0;
- QTest::newRow("overlap6")
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)3.5
- << (qreal)1.0 << (qreal)2.0 << (qreal)2.5
- << false << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)2.5
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.5;
-
- QTest::newRow("surround")
- << (qreal)-2.0 << (qreal)-3.0 << (qreal)-4.0
- << (qreal)2.0 << (qreal)3.0 << (qreal)4.0
- << false << true
- << (qreal)-1.0 << (qreal)-2.0 << (qreal)-3.0
- << (qreal)1.0 << (qreal)2.0 << (qreal)3.0
- << (qreal)-2.0 << (qreal)-3.0 << (qreal)-4.0
- << (qreal)2.0 << (qreal)3.0 << (qreal)4.0;
-}
-void tst_QBox3D::containsBox()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
-
- if (contained)
- QVERIFY(box.contains(other));
- else
- QVERIFY(!box.contains(other));
-
- QBox3D null;
- QVERIFY(!null.contains(other));
-
- QBox3D infinite;
- infinite.setToInfinite();
- QVERIFY(infinite.contains(other));
-
- QVERIFY(!box.contains(null));
- QVERIFY(!box.contains(infinite));
-}
-
-void tst_QBox3D::intersects_data()
-{
- // Use the same test data as containsBox().
- containsBox_data();
-}
-void tst_QBox3D::intersects()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
- QFETCH(bool, intersects);
-
- Q_UNUSED(contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
-
- if (intersects)
- QVERIFY(box.intersects(other));
- else
- QVERIFY(!box.intersects(other));
-
- QBox3D null;
- QVERIFY(!null.intersects(other));
-
- QBox3D infinite;
- infinite.setToInfinite();
- QVERIFY(infinite.intersects(other));
-
- QVERIFY(!box.intersects(null));
- QVERIFY(box.intersects(infinite));
-}
-
-void tst_QBox3D::intersect_data()
-{
- // Use the same test data as containsBox().
- containsBox_data();
-}
-void tst_QBox3D::intersect()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
- QFETCH(bool, intersects);
- QFETCH(qreal, ix1);
- QFETCH(qreal, iy1);
- QFETCH(qreal, iz1);
- QFETCH(qreal, ix2);
- QFETCH(qreal, iy2);
- QFETCH(qreal, iz2);
-
- Q_UNUSED(contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QBox3D result(QVector3D(ix1, iy1, iz1), QVector3D(ix2, iy2, iz2));
-
- QBox3D ibox(box);
- ibox.intersect(other);
- if (intersects)
- QVERIFY(ibox == result);
- else
- QVERIFY(ibox.isNull());
-
- QBox3D null;
- null.intersect(other);
- QVERIFY(null.isNull());
-
- QBox3D infinite;
- infinite.setToInfinite();
- infinite.intersect(other);
- QVERIFY(infinite == other);
-
- QBox3D ibox2(box);
- QBox3D null2;
- ibox2.intersect(null2);
- QVERIFY(ibox2.isNull());
-
- QBox3D ibox3(box);
- QBox3D infinite2;
- infinite2.setToInfinite();
- ibox3.intersect(infinite2);
- QVERIFY(ibox3 == box);
-}
-
-void tst_QBox3D::intersected_data()
-{
- // Use the same test data as containsBox().
- containsBox_data();
-}
-void tst_QBox3D::intersected()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
- QFETCH(bool, intersects);
- QFETCH(qreal, ix1);
- QFETCH(qreal, iy1);
- QFETCH(qreal, iz1);
- QFETCH(qreal, ix2);
- QFETCH(qreal, iy2);
- QFETCH(qreal, iz2);
-
- Q_UNUSED(contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QBox3D result(QVector3D(ix1, iy1, iz1), QVector3D(ix2, iy2, iz2));
-
- QBox3D ibox = box.intersected(other);
- if (intersects)
- QVERIFY(ibox == result);
- else
- QVERIFY(ibox.isNull());
-
- QBox3D null;
- ibox = null.intersected(other);
- QVERIFY(ibox.isNull());
-
- QBox3D infinite;
- infinite.setToInfinite();
- ibox = infinite.intersected(other);
- QVERIFY(ibox == other);
-
- QVERIFY(box.intersected(null).isNull());
- QVERIFY(box.intersected(infinite) == box);
-}
-
-void tst_QBox3D::intersectRay_data()
-{
- QTest::addColumn<qreal>("x1");
- QTest::addColumn<qreal>("y1");
- QTest::addColumn<qreal>("z1");
- QTest::addColumn<qreal>("x2");
- QTest::addColumn<qreal>("y2");
- QTest::addColumn<qreal>("z2");
- QTest::addColumn<bool>("intersects");
- QTest::addColumn<qreal>("mint");
- QTest::addColumn<qreal>("maxt");
- QTest::addColumn<qreal>("originx");
- QTest::addColumn<qreal>("originy");
- QTest::addColumn<qreal>("originz");
- QTest::addColumn<qreal>("directionx");
- QTest::addColumn<qreal>("directiony");
- QTest::addColumn<qreal>("directionz");
-
- QTest::newRow("zero")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("zero-x")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(1.0) << qreal(1.0)
- << qreal(-1.0) << qreal(0.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("zero-neg-x")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(-1.0) << qreal(-1.0)
- << qreal(-1.0) << qreal(0.0) << qreal(0.0)
- << qreal(-1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("zero-x-miss")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("zero-y")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(1.0) << qreal(1.0)
- << qreal(0.0) << qreal(-1.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.0) << qreal(0.0);
-
- QTest::newRow("zero-neg-y")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(-1.0) << qreal(-1.0)
- << qreal(0.0) << qreal(-1.0) << qreal(0.0)
- << qreal(0.0) << qreal(-1.0) << qreal(0.0);
-
- QTest::newRow("zero-y-miss")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(-1.0) << qreal(0.0);
-
- QTest::newRow("zero-z")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(1.0) << qreal(1.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0)
- << qreal(0.0) << qreal(0.0) << qreal(-1.0);
-
- QTest::newRow("zero-neg-z")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << true << qreal(-1.0) << qreal(-1.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0);
-
- QTest::newRow("zero-z-miss")
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0);
-
- QTest::newRow("normal-no-ray")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-inside-x")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-1.0) << qreal(1.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-inside-neg-x")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-2.0) << qreal(2.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(-0.5) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-inside-y")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-2.0) << qreal(2.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.0) << qreal(0.0);
-
- QTest::newRow("normal-from-inside-neg-y")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-4.0) << qreal(4.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(-0.5) << qreal(0.0);
-
- QTest::newRow("normal-from-inside-z")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-3.0) << qreal(3.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0);
-
- QTest::newRow("normal-from-inside-neg-z")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-6.0) << qreal(6.0)
- << qreal(0.0) << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(0.0) << qreal(-0.5);
-
- QTest::newRow("normal-from-outside-x")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(1.0) << qreal(3.0)
- << qreal(-2.0) << qreal(0.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-neg-x")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-6.0) << qreal(-2.0)
- << qreal(-2.0) << qreal(0.0) << qreal(0.0)
- << qreal(-0.5) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-miss-x")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(-2.0) << qreal(3.0) << qreal(0.0)
- << qreal(1.0) << qreal(0.0) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-y")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(1.0) << qreal(5.0)
- << qreal(0.0) << qreal(-3.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.0) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-neg-y")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-10.0) << qreal(-2.0)
- << qreal(0.0) << qreal(-3.0) << qreal(0.0)
- << qreal(0.0) << qreal(-0.5) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-miss-y")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(2.0) << qreal(-3.0) << qreal(0.0)
- << qreal(0.0) << qreal(1.5) << qreal(0.0);
-
- QTest::newRow("normal-from-outside-z")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(1.0) << qreal(7.0)
- << qreal(0.0) << qreal(0.0) << qreal(-4.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.0);
-
- QTest::newRow("normal-from-outside-neg-z")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << true << qreal(-14.0) << qreal(-2.0)
- << qreal(0.0) << qreal(0.0) << qreal(-4.0)
- << qreal(0.0) << qreal(0.0) << qreal(-0.5);
-
- QTest::newRow("normal-from-outside-miss-z")
- << qreal(-1.0) << qreal(-2.0) << qreal(-3.0)
- << qreal(1.0) << qreal(2.0) << qreal(3.0)
- << false << qreal(0.0) << qreal(0.0)
- << qreal(0.0) << qreal(3.0) << qreal(-4.0)
- << qreal(0.0) << qreal(0.0) << qreal(1.5);
-}
-
-void tst_QBox3D::intersectRay()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, intersects);
- QFETCH(qreal, mint);
- QFETCH(qreal, maxt);
- QFETCH(qreal, originx);
- QFETCH(qreal, originy);
- QFETCH(qreal, originz);
- QFETCH(qreal, directionx);
- QFETCH(qreal, directiony);
- QFETCH(qreal, directionz);
-
- QBox3D box(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QRay3D ray(QVector3D(originx, originy, originz),
- QVector3D(directionx, directiony, directionz));
-
- qreal minimum_t = -1.0f, maximum_t = -1.0f;
- if (intersects) {
- QVERIFY(box.intersection(ray, &minimum_t, &maximum_t));
- QCOMPARE(minimum_t, mint);
- QCOMPARE(maximum_t, maxt);
- QVERIFY(box.intersects(ray));
- qreal t = box.intersection(ray);
- if (mint >= 0.0f)
- QCOMPARE(t, mint);
- else if (maxt >= 0.0f)
- QCOMPARE(t, maxt);
- else
- QVERIFY(qIsNaN(t));
- } else {
- QVERIFY(!box.intersection(ray, &minimum_t, &maximum_t));
- QVERIFY(qIsNaN(minimum_t));
- QVERIFY(qIsNaN(maximum_t));
- QVERIFY(!box.intersects(ray));
- QVERIFY(qIsNaN(box.intersection(ray)));
- }
-}
-
-void tst_QBox3D::unitePoint_data()
-{
- // Use the same test data as containsPoint().
- containsPoint_data();
-}
-void tst_QBox3D::unitePoint()
-{
- QFETCH(qreal, x);
- QFETCH(qreal, y);
- QFETCH(qreal, z);
- QFETCH(bool, contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(4, 5, 6));
-
- QBox3D result(box);
- result.unite(QVector3D(x, y, z));
-
- if (contained) {
- QVERIFY(result == box);
- } else {
- qreal minx = (x < -1) ? x : -1;
- qreal miny = (y < -2) ? y : -2;
- qreal minz = (z < -3) ? z : -3;
- qreal maxx = (x > 4) ? x : 4;
- qreal maxy = (y > 5) ? y : 5;
- qreal maxz = (z > 6) ? z : 6;
- QBox3D expected(QVector3D(minx, miny, minz), QVector3D(maxx, maxy, maxz));
- QVERIFY(result == expected);
- }
-
- QBox3D null;
- null.unite(QVector3D(x, y, z));
- QVERIFY(null == QBox3D(QVector3D(x, y, z), QVector3D(x, y, z)));
-
- QBox3D infinite;
- infinite.setToInfinite();
- infinite.unite(QVector3D(x, y, z));
- QVERIFY(infinite.isInfinite());
-}
-
-void tst_QBox3D::uniteBox_data()
-{
- // Use the same test data as containsBox().
- containsBox_data();
-}
-void tst_QBox3D::uniteBox()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
- QFETCH(bool, intersects);
- QFETCH(qreal, ix1);
- QFETCH(qreal, iy1);
- QFETCH(qreal, iz1);
- QFETCH(qreal, ix2);
- QFETCH(qreal, iy2);
- QFETCH(qreal, iz2);
- QFETCH(qreal, ex1);
- QFETCH(qreal, ey1);
- QFETCH(qreal, ez1);
- QFETCH(qreal, ex2);
- QFETCH(qreal, ey2);
- QFETCH(qreal, ez2);
-
- Q_UNUSED(contained);
- Q_UNUSED(intersects);
- Q_UNUSED(ix1);
- Q_UNUSED(iy1);
- Q_UNUSED(iz1);
- Q_UNUSED(ix2);
- Q_UNUSED(iy2);
- Q_UNUSED(iz2);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QBox3D result(QVector3D(ex1, ey1, ez1), QVector3D(ex2, ey2, ez2));
-
- QBox3D ibox(box);
- ibox.unite(other);
- QVERIFY(ibox == result);
-
- QBox3D null;
- null.unite(other);
- QVERIFY(null == other);
-
- QBox3D infinite;
- infinite.setToInfinite();
- infinite.unite(other);
- QVERIFY(infinite.isInfinite());
-
- QBox3D ibox2(box);
- QBox3D null2;
- ibox2.unite(null2);
- QVERIFY(ibox2 == box);
-
- QBox3D ibox3(box);
- QBox3D infinite2;
- infinite2.setToInfinite();
- ibox3.unite(infinite2);
- QVERIFY(ibox3.isInfinite());
-}
-
-void tst_QBox3D::unitedPoint_data()
-{
- // Use the same test data as containsPoint().
- containsPoint_data();
-}
-void tst_QBox3D::unitedPoint()
-{
- QFETCH(qreal, x);
- QFETCH(qreal, y);
- QFETCH(qreal, z);
- QFETCH(bool, contained);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(4, 5, 6));
-
- QBox3D result = box.united(QVector3D(x, y, z));
-
- if (contained) {
- QVERIFY(result == box);
- } else {
- qreal minx = (x < -1) ? x : -1;
- qreal miny = (y < -2) ? y : -2;
- qreal minz = (z < -3) ? z : -3;
- qreal maxx = (x > 4) ? x : 4;
- qreal maxy = (y > 5) ? y : 5;
- qreal maxz = (z > 6) ? z : 6;
- QBox3D expected(QVector3D(minx, miny, minz), QVector3D(maxx, maxy, maxz));
- QVERIFY(result == expected);
- }
-
- QBox3D null;
- result = null.united(QVector3D(x, y, z));
- QVERIFY(result == QBox3D(QVector3D(x, y, z), QVector3D(x, y, z)));
-
- QBox3D infinite;
- infinite.setToInfinite();
- result = infinite.united(QVector3D(x, y, z));
- QVERIFY(result.isInfinite());
-}
-
-void tst_QBox3D::unitedBox_data()
-{
- // Use the same test data as containsBox().
- containsBox_data();
-}
-void tst_QBox3D::unitedBox()
-{
- QFETCH(qreal, x1);
- QFETCH(qreal, y1);
- QFETCH(qreal, z1);
- QFETCH(qreal, x2);
- QFETCH(qreal, y2);
- QFETCH(qreal, z2);
- QFETCH(bool, contained);
- QFETCH(bool, intersects);
- QFETCH(qreal, ix1);
- QFETCH(qreal, iy1);
- QFETCH(qreal, iz1);
- QFETCH(qreal, ix2);
- QFETCH(qreal, iy2);
- QFETCH(qreal, iz2);
- QFETCH(qreal, ex1);
- QFETCH(qreal, ey1);
- QFETCH(qreal, ez1);
- QFETCH(qreal, ex2);
- QFETCH(qreal, ey2);
- QFETCH(qreal, ez2);
-
- Q_UNUSED(contained);
- Q_UNUSED(intersects);
- Q_UNUSED(ix1);
- Q_UNUSED(iy1);
- Q_UNUSED(iz1);
- Q_UNUSED(ix2);
- Q_UNUSED(iy2);
- Q_UNUSED(iz2);
-
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QBox3D other(QVector3D(x1, y1, z1), QVector3D(x2, y2, z2));
- QBox3D result(QVector3D(ex1, ey1, ez1), QVector3D(ex2, ey2, ez2));
-
- QBox3D ibox = box.united(other);
- QVERIFY(ibox == result);
-
- QBox3D null;
- ibox = null.united(other);
- QVERIFY(ibox == other);
-
- QBox3D infinite;
- infinite.setToInfinite();
- ibox = infinite.united(other);
- QVERIFY(ibox.isInfinite());
-
- QBox3D ibox2(box);
- QBox3D null2;
- ibox = ibox2.united(null2);
- QVERIFY(ibox == box);
-
- QBox3D ibox3(box);
- QBox3D infinite2;
- infinite2.setToInfinite();
- ibox = ibox3.united(infinite2);
- QVERIFY(ibox.isInfinite());
-}
-
-void tst_QBox3D::transform()
-{
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QMatrix4x4 m;
- m.rotate(90, 0, 1, 0);
- box.transform(m);
- QVERIFY(box.minimum() == QVector3D(-3, -2, -1));
- QVERIFY(box.maximum() == QVector3D(3, 2, 1));
-
- QBox3D null;
- null.transform(m);
- QVERIFY(null.isNull());
-
- QBox3D infinite;
- infinite.setToInfinite();
- infinite.transform(m);
- QVERIFY(infinite.isInfinite());
-}
-
-void tst_QBox3D::transformed()
-{
- QBox3D box(QVector3D(-1, -2, -3), QVector3D(1, 2, 3));
- QMatrix4x4 m;
- m.rotate(90, 0, 1, 0);
- QBox3D box2 = box.transformed(m);
- QVERIFY(box2.minimum() == QVector3D(-3, -2, -1));
- QVERIFY(box2.maximum() == QVector3D(3, 2, 1));
-
- QBox3D null;
- box2 = null.transformed(m);
- QVERIFY(box2.isNull());
-
- QBox3D infinite;
- infinite.setToInfinite();
- box2 = infinite.transformed(m);
- QVERIFY(box2.isInfinite());
-}
-
-void tst_QBox3D::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QBox3D box1(QVector3D(1.0f, 2.0f, 3.0f), QVector3D(4.0f, 5.0f, 6.0f));
- QBox3D box2; // null
- QBox3D box3;
- box3.setToInfinite();
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << box1;
- stream << box2;
- stream << box3;
- }
-
- QBox3D rbox1;
- QBox3D rbox2;
- QBox3D rbox3;
- {
- QDataStream stream2(data);
- stream2 >> rbox1;
- stream2 >> rbox2;
- stream2 >> rbox3;
- }
-
- QVERIFY(box1 == rbox1);
- QVERIFY(box2 == rbox2);
- QVERIFY(box3 == rbox3);
-#endif
-}
-
-class tst_QBox3DProperties : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QBox3D box READ box WRITE setBox)
-public:
- tst_QBox3DProperties(QObject *parent = 0) : QObject(parent) {}
-
- QBox3D box() const { return b; }
- void setBox(const QBox3D& value) { b = value; }
-
-private:
- QBox3D b;
-};
-
-// Test getting and setting properties via the metaobject system.
-void tst_QBox3D::properties()
-{
- tst_QBox3DProperties obj;
-
- qRegisterMetaType<QBox3D>();
-
- obj.setBox(QBox3D(QVector3D(1, 2, 3), QVector3D(4, 5, 6)));
-
- QBox3D b = qVariantValue<QBox3D>(obj.property("box"));
- QCOMPARE(b.minimum(), QVector3D(1, 2, 3));
- QCOMPARE(b.maximum(), QVector3D(4, 5, 6));
-
- obj.setProperty("box",
- qVariantFromValue
- (QBox3D(QVector3D(-1, -2, -3), QVector3D(-4, -5, -6))));
-
- b = qVariantValue<QBox3D>(obj.property("box"));
- QCOMPARE(b.minimum(), QVector3D(-4, -5, -6));
- QCOMPARE(b.maximum(), QVector3D(-1, -2, -3));
-}
-
-void tst_QBox3D::metaTypes()
-{
- int id = qMetaTypeId<QBox3D>();
- QVERIFY(QMetaType::type("QBox3D") == id);
- QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("QBox3D"));
- QVERIFY(QMetaType::isRegistered(id));
-}
-
-QTEST_APPLESS_MAIN(tst_QBox3D)
-
-#include "tst_qbox3d.moc"
diff --git a/tests/auto/threed/qcolor4ub/qcolor4ub.pro b/tests/auto/threed/qcolor4ub/qcolor4ub.pro
deleted file mode 100644
index 64c1166d..00000000
--- a/tests/auto/threed/qcolor4ub/qcolor4ub.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qcolor4ub
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qcolor4ub.cpp
diff --git a/tests/auto/threed/qcolor4ub/tst_qcolor4ub.cpp b/tests/auto/threed/qcolor4ub/tst_qcolor4ub.cpp
deleted file mode 100644
index 73c625ee..00000000
--- a/tests/auto/threed/qcolor4ub/tst_qcolor4ub.cpp
+++ /dev/null
@@ -1,341 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qcolor4ub.h"
-
-class tst_QColor4ub : public QObject
-{
- Q_OBJECT
-public:
- tst_QColor4ub() {}
- ~tst_QColor4ub() {}
-
-private slots:
- void create();
- void modify();
- void copy();
- void compare_data();
- void compare();
- void toColor();
- void checkSize();
-};
-
-#define fuzzyCompare(x,y) (qAbs((x) - (y)) < 0.0001)
-
-void tst_QColor4ub::create()
-{
- QColor4ub c1;
- QCOMPARE(c1.red(), 0);
- QCOMPARE(c1.green(), 0);
- QCOMPARE(c1.blue(), 0);
- QCOMPARE(c1.alpha(), 255);
- QCOMPARE(c1.redF(), qreal(0.0));
- QCOMPARE(c1.greenF(), qreal(0.0));
- QCOMPARE(c1.blueF(), qreal(0.0));
- QCOMPARE(c1.alphaF(), qreal(1.0));
-
- QColor4ub c2(162, 54, 39);
- QCOMPARE(c2.red(), 162);
- QCOMPARE(c2.green(), 54);
- QCOMPARE(c2.blue(), 39);
- QCOMPARE(c2.alpha(), 255);
- QVERIFY(fuzzyCompare(c2.redF(), qreal(162 / 255.0f)));
- QVERIFY(fuzzyCompare(c2.greenF(), qreal(54 / 255.0f)));
- QVERIFY(fuzzyCompare(c2.blueF(), qreal(39 / 255.0f)));
- QVERIFY(fuzzyCompare(c2.alphaF(), qreal(1.0)));
-
- QColor4ub c3(162, 54, 39, 41);
- QCOMPARE(c3.red(), 162);
- QCOMPARE(c3.green(), 54);
- QCOMPARE(c3.blue(), 39);
- QCOMPARE(c3.alpha(), 41);
- QVERIFY(fuzzyCompare(c3.redF(), qreal(162 / 255.0f)));
- QVERIFY(fuzzyCompare(c3.greenF(), qreal(54 / 255.0f)));
- QVERIFY(fuzzyCompare(c3.blueF(), qreal(39 / 255.0f)));
- QVERIFY(fuzzyCompare(c3.alphaF(), qreal(41 / 255.0f)));
-
- QColor4ub c4(QColor(162, 54, 39, 41));
- QCOMPARE(c4.red(), 162);
- QCOMPARE(c4.green(), 54);
- QCOMPARE(c4.blue(), 39);
- QCOMPARE(c4.alpha(), 41);
-
- QColor4ub c5(Qt::red);
- QCOMPARE(c5.red(), 255);
- QCOMPARE(c5.green(), 0);
- QCOMPARE(c5.blue(), 0);
- QCOMPARE(c5.alpha(), 255);
-
- QColor4ub c6(qRgb(162, 54, 39));
- QCOMPARE(c6.red(), 162);
- QCOMPARE(c6.green(), 54);
- QCOMPARE(c6.blue(), 39);
- QCOMPARE(c6.alpha(), 255);
-
- QColor4ub c7(qRgba(162, 54, 39, 41));
- QCOMPARE(c7.red(), 162);
- QCOMPARE(c7.green(), 54);
- QCOMPARE(c7.blue(), 39);
- QCOMPARE(c7.alpha(), 41);
-
- QColor4ub c8(256, -3, 1); // truncates from int to uchar
- QCOMPARE(c8.red(), 0);
- QCOMPARE(c8.green(), 253);
- QCOMPARE(c8.blue(), 1);
- QCOMPARE(c8.alpha(), 255);
-
- QColor4ub c9 = QColor4ub::fromRgb(162, 54, 39);
- QCOMPARE(c9.red(), 162);
- QCOMPARE(c9.green(), 54);
- QCOMPARE(c9.blue(), 39);
- QCOMPARE(c9.alpha(), 255);
- c9 = QColor4ub::fromRgb(162, 54, 39, 41);
- QCOMPARE(c9.red(), 162);
- QCOMPARE(c9.green(), 54);
- QCOMPARE(c9.blue(), 39);
- QCOMPARE(c9.alpha(), 41);
-
- QColor4ub c10 = QColor4ub::fromRgbF(1.0f, 0.5f, 0.25f);
- QCOMPARE(c10.red(), 255);
- QCOMPARE(c10.green(), 128);
- QCOMPARE(c10.blue(), 64);
- QCOMPARE(c10.alpha(), 255);
- c10 = QColor4ub::fromRgbF(1.0f, 0.5f, 0.25f, 0.75f);
- QCOMPARE(c10.red(), 255);
- QCOMPARE(c10.green(), 128);
- QCOMPARE(c10.blue(), 64);
- QCOMPARE(c10.alpha(), 191);
-
- static uchar const data[4] = {uchar(162), uchar(54), uchar(39), uchar(255)};
- QColor4ub c11 = QColor4ub::fromRaw(data);
- QCOMPARE(c11.red(), 162);
- QCOMPARE(c11.green(), 54);
- QCOMPARE(c11.blue(), 39);
- QCOMPARE(c11.alpha(), 255);
-}
-
-void tst_QColor4ub::modify()
-{
- QColor4ub c1(162, 54, 39, 41);
- c1.setRed(34);
- c1.setGreen(163);
- c1.setBlue(2);
- c1.setAlpha(200);
- QCOMPARE(c1.red(), 34);
- QCOMPARE(c1.green(), 163);
- QCOMPARE(c1.blue(), 2);
- QCOMPARE(c1.alpha(), 200);
- QVERIFY(fuzzyCompare(c1.redF(), qreal(34 / 255.0f)));
- QVERIFY(fuzzyCompare(c1.greenF(), qreal(163 / 255.0f)));
- QVERIFY(fuzzyCompare(c1.blueF(), qreal(2 / 255.0f)));
- QVERIFY(fuzzyCompare(c1.alphaF(), qreal(200 / 255.0f)));
-
- QColor4ub c2;
- c2.setRedF(1.0f);
- c2.setGreenF(0.5f);
- c2.setBlueF(0.25f);
- c2.setAlphaF(0.75f);
- QCOMPARE(c2.red(), 255);
- QCOMPARE(c2.green(), 128);
- QCOMPARE(c2.blue(), 64);
- QCOMPARE(c2.alpha(), 191);
- QVERIFY(fuzzyCompare(c2.redF(), qreal(1.0)));
- QVERIFY(fuzzyCompare(c2.greenF(), qreal(128 / 255.0f)));
- QVERIFY(fuzzyCompare(c2.blueF(), qreal(64 / 255.0f)));
- QVERIFY(fuzzyCompare(c2.alphaF(), qreal(191 / 255.0f)));
-
- QColor4ub c3;
- c3.setRgb(162, 54, 39);
- QCOMPARE(c3.red(), 162);
- QCOMPARE(c3.green(), 54);
- QCOMPARE(c3.blue(), 39);
- QCOMPARE(c3.alpha(), 255);
- c3.setRgb(162, 54, 39, 41);
- QCOMPARE(c3.red(), 162);
- QCOMPARE(c3.green(), 54);
- QCOMPARE(c3.blue(), 39);
- QCOMPARE(c3.alpha(), 41);
-
- QColor4ub c4;
- c4.setRgbF(1.0f, 0.5f, 0.25f);
- QCOMPARE(c4.red(), 255);
- QCOMPARE(c4.green(), 128);
- QCOMPARE(c4.blue(), 64);
- QCOMPARE(c4.alpha(), 255);
- c4.setRgbF(1.0f, 0.5f, 0.25f, 0.75f);
- QCOMPARE(c4.red(), 255);
- QCOMPARE(c4.green(), 128);
- QCOMPARE(c4.blue(), 64);
- QCOMPARE(c4.alpha(), 191);
-}
-
-void tst_QColor4ub::copy()
-{
- QColor4ub c1(162, 54, 39, 41);
- QColor4ub c2(c1);
- QCOMPARE(c2.red(), 162);
- QCOMPARE(c2.green(), 54);
- QCOMPARE(c2.blue(), 39);
- QCOMPARE(c2.alpha(), 41);
-
- QColor4ub c3;
- c3 = c2;
- QCOMPARE(c3.red(), 162);
- QCOMPARE(c3.green(), 54);
- QCOMPARE(c3.blue(), 39);
- QCOMPARE(c3.alpha(), 41);
-
- c1 = Qt::red;
- QCOMPARE(c1.red(), 255);
- QCOMPARE(c1.green(), 0);
- QCOMPARE(c1.blue(), 0);
- QCOMPARE(c1.alpha(), 255);
-
- c2 = QColor(162, 54, 39, 41);
- QCOMPARE(c2.red(), 162);
- QCOMPARE(c2.green(), 54);
- QCOMPARE(c2.blue(), 39);
- QCOMPARE(c2.alpha(), 41);
-
- c1 = c2;
- QCOMPARE(c1.red(), 162);
- QCOMPARE(c1.green(), 54);
- QCOMPARE(c1.blue(), 39);
- QCOMPARE(c1.alpha(), 41);
-}
-
-void tst_QColor4ub::compare_data()
-{
- QTest::addColumn<int>("red1");
- QTest::addColumn<int>("green1");
- QTest::addColumn<int>("blue1");
- QTest::addColumn<int>("alpha1");
- QTest::addColumn<int>("red2");
- QTest::addColumn<int>("green2");
- QTest::addColumn<int>("blue2");
- QTest::addColumn<int>("alpha2");
- QTest::addColumn<bool>("isEqual");
-
- QTest::newRow("black")
- << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0
- << true;
-
- QTest::newRow("white")
- << 255 << 255 << 255 << 255
- << 255 << 255 << 255 << 255
- << true;
-
- QTest::newRow("mixed")
- << 162 << 54 << 39 << 41
- << 162 << 54 << 39 << 41
- << true;
-
- QTest::newRow("red-diff")
- << 162 << 54 << 39 << 41
- << 161 << 54 << 39 << 41
- << false;
-
- QTest::newRow("green-diff")
- << 162 << 54 << 39 << 41
- << 162 << 53 << 39 << 41
- << false;
-
- QTest::newRow("blue-diff")
- << 162 << 54 << 39 << 41
- << 162 << 54 << 38 << 41
- << false;
-
- QTest::newRow("alpha-diff")
- << 162 << 54 << 39 << 41
- << 162 << 54 << 39 << 40
- << false;
-
- QTest::newRow("all-diff")
- << 162 << 54 << 39 << 41
- << 161 << 53 << 38 << 40
- << false;
-}
-
-void tst_QColor4ub::compare()
-{
- QFETCH(int, red1);
- QFETCH(int, green1);
- QFETCH(int, blue1);
- QFETCH(int, alpha1);
- QFETCH(int, red2);
- QFETCH(int, green2);
- QFETCH(int, blue2);
- QFETCH(int, alpha2);
- QFETCH(bool, isEqual);
-
- QColor4ub c1(red1, green1, blue1, alpha1);
- QColor4ub c2(red2, green2, blue2, alpha2);
-
- if (isEqual) {
- QVERIFY(c1 == c2);
- QVERIFY(!(c1 != c2));
- } else {
- QVERIFY(!(c1 == c2));
- QVERIFY(c1 != c2);
- }
-}
-
-void tst_QColor4ub::toColor()
-{
- QColor4ub c1(162, 54, 39, 41);
- QColor c2 = c1.toColor();
- QCOMPARE(c2.red(), 162);
- QCOMPARE(c2.green(), 54);
- QCOMPARE(c2.blue(), 39);
- QCOMPARE(c2.alpha(), 41);
-}
-
-void tst_QColor4ub::checkSize()
-{
- // We need QColor4ub to be precisely packed as four single-byte values.
- QCOMPARE(sizeof(QColor4ub), sizeof(uchar) * 4);
-}
-
-QTEST_APPLESS_MAIN(tst_QColor4ub)
-
-#include "tst_qcolor4ub.moc"
diff --git a/tests/auto/threed/qcustomdataarray/qcustomdataarray.pro b/tests/auto/threed/qcustomdataarray/qcustomdataarray.pro
deleted file mode 100644
index e6cf6d24..00000000
--- a/tests/auto/threed/qcustomdataarray/qcustomdataarray.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qcustomdataarray
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qcustomdataarray.cpp
diff --git a/tests/auto/threed/qcustomdataarray/tst_qcustomdataarray.cpp b/tests/auto/threed/qcustomdataarray/tst_qcustomdataarray.cpp
deleted file mode 100644
index f65aa798..00000000
--- a/tests/auto/threed/qcustomdataarray/tst_qcustomdataarray.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qcustomdataarray.h"
-
-class tst_QCustomDataArray : public QObject
-{
- Q_OBJECT
-public:
- tst_QCustomDataArray() {}
- ~tst_QCustomDataArray() {}
-
-private slots:
- void create();
-};
-
-void tst_QCustomDataArray::create()
-{
- QCustomDataArray array1;
- QVERIFY(array1.elementType() == QCustomDataArray::Float);
- QVERIFY(array1.elementSize() == sizeof(float));
- QCOMPARE(array1.size(), 0);
- QCOMPARE(array1.count(), 0);
- QVERIFY(array1.isEmpty());
-
- array1.setElementType(QCustomDataArray::Vector3D);
- QVERIFY(array1.elementType() == QCustomDataArray::Vector3D);
- QVERIFY(array1.elementSize() == sizeof(QVector3D));
- QCOMPARE(array1.size(), 0);
- QCOMPARE(array1.count(), 0);
- QVERIFY(array1.isEmpty());
-
- QCustomDataArray array2(QCustomDataArray::Vector2D);
- QVERIFY(array2.elementType() == QCustomDataArray::Vector2D);
- QVERIFY(array2.elementSize() == sizeof(QVector2D));
- QCOMPARE(array2.size(), 0);
- QCOMPARE(array2.count(), 0);
- QVERIFY(array2.isEmpty());
-
- QCustomDataArray array3(QCustomDataArray::Vector3D, 20);
- QVERIFY(array3.elementType() == QCustomDataArray::Vector3D);
- QVERIFY(array3.elementSize() == sizeof(QVector3D));
- QCOMPARE(array3.size(), 20);
- QCOMPARE(array3.count(), 20);
- QVERIFY(!array3.isEmpty());
- QVERIFY(array3.capacity() >= 20);
-
- QCustomDataArray array4(QCustomDataArray::Vector4D, 20);
- QVERIFY(array4.elementType() == QCustomDataArray::Vector4D);
- QVERIFY(array4.elementSize() == sizeof(QVector4D));
- QCOMPARE(array4.size(), 20);
- QCOMPARE(array4.count(), 20);
- QVERIFY(!array4.isEmpty());
- array4.append(QVector4D(1.0f, 2.0f, 3.0f, 4.0f));
-
- QCustomDataArray array5(QCustomDataArray::Color, 10);
- QVERIFY(array5.elementType() == QCustomDataArray::Color);
- QVERIFY(array5.elementSize() == sizeof(QColor4ub));
- QCOMPARE(array5.size(), 10);
- QCOMPARE(array5.count(), 10);
- QVERIFY(!array5.isEmpty());
- array5.append(Qt::red);
- array5.setAt(4, Qt::green);
- QVERIFY(array5.colorAt(4) == Qt::green);
-
- QCustomDataArray array6(array5);
- QVERIFY(array6.elementType() == QCustomDataArray::Color);
- QVERIFY(array6.elementSize() == sizeof(QColor4ub));
- QCOMPARE(array6.size(), 11);
- QCOMPARE(array6.count(), 11);
- QVERIFY(!array6.isEmpty());
- QVERIFY(array6.colorAt(10) == Qt::red);
-
- // Changes element type from Color to Vector4D.
- array6 = array4;
- QVERIFY(array6.elementType() == QCustomDataArray::Vector4D);
- QVERIFY(array6.elementSize() == sizeof(QVector4D));
- QCOMPARE(array6.size(), 21);
- QCOMPARE(array6.count(), 21);
- QVERIFY(!array6.isEmpty());
- QVERIFY(array6.vector4DAt(20) == QVector4D(1.0f, 2.0f, 3.0f, 4.0f));
-
- array6.clear();
- QVERIFY(array6.elementType() == QCustomDataArray::Vector4D);
- QVERIFY(array6.elementSize() == sizeof(QVector4D));
- QCOMPARE(array6.size(), 0);
- QCOMPARE(array6.count(), 0);
- QVERIFY(array6.isEmpty());
-
- array6.setElementType(QCustomDataArray::Vector3D);
- QVERIFY(array6.elementType() == QCustomDataArray::Vector3D);
- QVERIFY(array6.elementSize() == sizeof(QVector3D));
- QCOMPARE(array6.size(), 0);
- QCOMPARE(array6.count(), 0);
- QVERIFY(array6.isEmpty());
-}
-
-QTEST_APPLESS_MAIN(tst_QCustomDataArray)
-
-#include "tst_qcustomdataarray.moc"
diff --git a/tests/auto/threed/qgeometrydata/qgeometrydata.pro b/tests/auto/threed/qgeometrydata/qgeometrydata.pro
deleted file mode 100644
index f2a624ed..00000000
--- a/tests/auto/threed/qgeometrydata/qgeometrydata.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TARGET = tst_qgeometrydata
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-INCLUDEPATH += ../../../../src/threed/geometry
-
-SOURCES += tst_qgeometrydata.cpp
-QT += widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp b/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp
deleted file mode 100644
index ee174a8c..00000000
--- a/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp
+++ /dev/null
@@ -1,631 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtCore/qpointer.h>
-
-#include "qgeometrydata.h"
-#include "qvector_utils_p.h"
-#include "qtest_helpers.h"
-#include "qglpainter.h"
-#include "qglview.h"
-
-#include <QtCore/qdebug.h>
-
-class tst_QGeometryData : public QObject
-{
- Q_OBJECT
-public:
- tst_QGeometryData() {}
- ~tst_QGeometryData() {}
-
-private slots:
- void createDefault();
- void appendVertex();
- void appendNormal();
- void appendVertexNormal();
- void copy();
- void interleaveWith();
- void boundingBox();
- void center();
- void normalizeNormals();
- void reversed();
- void translated();
- void generateTextureCoordinates();
- void clear();
- void draw();
-};
-
-void tst_QGeometryData::createDefault()
-{
- QGeometryData data;
- QCOMPARE(data.count(), 0);
- QCOMPARE(data.attributes().count(), 0);
- QCOMPARE(data.fields(), quint32(0));
- QCOMPARE(data.vertices().count(), 0);
- data.normalizeNormals();
- QCOMPARE(data.boundingBox(), QBox3D());
-
- // copy constructor on initialization - null default
- QGeometryData other = data;
- QCOMPARE(other.count(), 0);
- QCOMPARE(other.attributes().count(), 0);
- QCOMPARE(other.fields(), quint32(0));
-
- // copy constructor on default
- QGeometryData copy(data);
- QCOMPARE(copy.count(), 0);
- QCOMPARE(copy.attributes().count(), 0);
- QCOMPARE(copy.fields(), quint32(0));
-}
-
-void tst_QGeometryData::appendVertex()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- {
- QGeometryData data;
- data.appendVertex(a);
- QCOMPARE(data.count(), 1);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(data.vertices().count(), 1);
- QCOMPARE(data.vertices().at(0), a);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b);
- QCOMPARE(data.count(), 2);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(data.vertices().count(), 2);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c);
- QCOMPARE(data.count(), 3);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(data.vertices().count(), 3);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(2), c);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(data.vertices().count(), 4);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(2), c);
- QCOMPARE(data.vertices().at(3), d);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendVertex(a, b, c, d);
- data.appendVertex(a);
- QCOMPARE(data.count(), 9);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(data.vertices().count(), 9);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(5), b);
- QCOMPARE(data.vertices().at(8), a);
- }
-}
-
-void tst_QGeometryData::appendNormal()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- {
- QGeometryData data;
- data.appendNormal(a);
- QCOMPARE(data.count(), 1);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.normals().count(), 1);
- QCOMPARE(data.normals().at(0), a);
- }
- {
- QGeometryData data;
- data.appendNormal(a, b);
- QCOMPARE(data.count(), 2);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.normals().count(), 2);
- QCOMPARE(data.normals().at(0), a);
- QCOMPARE(data.normals().at(1), b);
- }
- {
- QGeometryData data;
- data.appendNormal(a, b, c);
- QCOMPARE(data.count(), 3);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.normals().count(), 3);
- QCOMPARE(data.normals().at(0), a);
- QCOMPARE(data.normals().at(1), b);
- QCOMPARE(data.normals().at(2), c);
- }
- {
- QGeometryData data;
- data.appendNormal(a, b, c, d);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.normals().count(), 4);
- QCOMPARE(data.normals().at(0), a);
- QCOMPARE(data.normals().at(1), b);
- QCOMPARE(data.normals().at(2), c);
- QCOMPARE(data.normals().at(3), d);
- }
- {
- QGeometryData data;
- data.appendNormal(a, b, c, d);
- data.appendNormal(a, b, c, d);
- data.appendNormal(a);
- QCOMPARE(data.count(), 9);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.normals().count(), 9);
- QCOMPARE(data.normals().at(0), a);
- QCOMPARE(data.normals().at(1), b);
- QCOMPARE(data.normals().at(5), b);
- QCOMPARE(data.normals().at(8), a);
- }
-}
-
-void tst_QGeometryData::appendVertexNormal()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
- {
- QGeometryData data;
- data.appendVertex(a);
- data.appendNormal(an);
- QCOMPARE(data.count(), 1);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.vertices().count(), 1);
- QCOMPARE(data.vertices().at(0), a);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b);
- data.appendNormal(an, bn);
- QCOMPARE(data.count(), 2);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.vertices().count(), 2);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertex(1), b);
- QCOMPARE(data.normals().count(), 2);
- QCOMPARE(data.normal(0), an);
- QCOMPARE(data.normals().at(1), bn);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c);
- data.appendNormal(an, bn, cn);
- QCOMPARE(data.count(), 3);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.vertices().count(), 3);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(2), c);
- QCOMPARE(data.normals().count(), 3);
- QCOMPARE(data.normal(0), an);
- QCOMPARE(data.normals().at(1), bn);
- QCOMPARE(data.normal(2), cn);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.vertices().count(), 4);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(2), c);
- QCOMPARE(data.vertices().at(3), d);
- QCOMPARE(data.normals().count(), 4);
- QCOMPARE(data.normals().at(0), an);
- QCOMPARE(data.normals().at(1), bn);
- QCOMPARE(data.normals().at(2), cn);
- QCOMPARE(data.normals().at(3), dn);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
- data.appendVertex(a);
- data.appendNormal(an);
- QCOMPARE(data.count(), 9);
- QCOMPARE(data.fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
- QCOMPARE(data.vertices().count(), 9);
- QCOMPARE(data.vertices().at(0), a);
- QCOMPARE(data.vertices().at(1), b);
- QCOMPARE(data.vertices().at(5), b);
- QCOMPARE(data.vertices().at(8), a);
- QCOMPARE(data.normals().count(), 9);
- QCOMPARE(data.normals().at(0), an);
- QCOMPARE(data.normals().at(1), bn);
- QCOMPARE(data.normals().at(5), bn);
- QCOMPARE(data.normals().at(8), an);
- }
-}
-
-
-QVector3D avec(99.1, 99.2, 99.3);
-
-static QGeometryData aFunc(const QGeometryData& g) // not a copy but a ref
-{
- QGeometryData d = g; // copy constructor
- d.appendVertex(avec);
- return d; // assingment operator
-}
-
-void tst_QGeometryData::copy()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- {
- QGeometryData data;
- QCOMPARE(data.count(), 0);
- QCOMPARE(data.fields(), (quint32)0);
- QGeometryData other;
- other.appendVertex(QVector3D());
- QCOMPARE(other.count(), 1);
- QCOMPARE(other.fields(), QGL::fieldMask(QGL::Position));
- other = aFunc(data); // assignment op - throw away previous d
- QCOMPARE(other.count(), 1);
- QCOMPARE(other.fields(), QGL::fieldMask(QGL::Position));
- QVector3D res = other.vertices().at(0);
- QCOMPARE(res, avec);
- }
- {
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- QGeometryData other;
- QCOMPARE(other.count(), 0);
- QCOMPARE(other.fields(), (quint32)0);
- other = aFunc(data); // assignment operator
- other.appendVertex(a);
- QCOMPARE(other.count(), 6);
- QCOMPARE(other.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(other.vertices().count(), 6);
- QCOMPARE(other.vertices().at(0), a);
- QCOMPARE(other.vertices().at(1), b);
- QCOMPARE(other.vertices().at(4), avec);
- QCOMPARE(other.vertices().at(5), a);
- }
-}
-
-void tst_QGeometryData::interleaveWith()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D vx(0.7071, 0.7071, 0.0);
- QVector2D at(0.11, 0.12);
- QVector2D bt(0.21, 0.22);
- QVector2D ct(0.31, 0.32);
- QVector2D dt(0.41, 0.42);
- QVector2D tx(1.0, 1.0);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendTexCoord(at, bt, ct, dt);
- QGeometryData dat2;
-
- // count is the smaller of the two - nothing in this null case
- // also make sure the argument does not somehow change - its a const
- // so it shouldn't...
- dat2.interleaveWith(data);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.vertex(0), a);
- QCOMPARE(dat2.count(), 0);
- QCOMPARE(dat2.count(QGL::Position), 0);
- QCOMPARE(dat2.fields(), quint32(0));
-
- // dat2 is smaller and has less fields
- dat2.appendVertex(a + vx, b + vx);
- dat2.interleaveWith(data);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.vertex(0), a);
- QCOMPARE(dat2.count(), 4);
- QCOMPARE(dat2.count(QGL::Position), 4);
- QCOMPARE(dat2.count(QGL::TextureCoord0), 0);
- QCOMPARE(dat2.fields(), QGL::fieldMask(QGL::Position));
- QCOMPARE(dat2.vertex(0), a + vx);
- QCOMPARE(dat2.vertex(1), a);
- QCOMPARE(dat2.vertex(2), b + vx);
- QCOMPARE(dat2.vertex(3), b);
-
- // full zip with both sides have 4 verts & textures
- dat2.clear();
- for (int i = 0; i < data.count(); ++i)
- {
- dat2.appendVertex(data.vertex(i) + vx);
- dat2.appendTexCoord(data.texCoord(i) + tx);
- }
- dat2.interleaveWith(data);
- QCOMPARE(dat2.count(), 8);
- QCOMPARE(dat2.count(QGL::Position), 8);
- QCOMPARE(dat2.count(QGL::TextureCoord0), 8);
- QCOMPARE(dat2.fields(), QGL::fieldMask(QGL::Position) |
- QGL::fieldMask(QGL::TextureCoord0));
- QCOMPARE(dat2.vertex(0), a + vx);
- QCOMPARE(dat2.vertex(1), a);
- QCOMPARE(dat2.vertex(4), c + vx);
- QCOMPARE(dat2.vertex(7), d);
- QCOMPARE(dat2.texCoord(0), at + tx);
- QCOMPARE(dat2.texCoord(3), bt);
- QCOMPARE(dat2.texCoord(7), dt);
-}
-
-void tst_QGeometryData::boundingBox()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
-
- QBox3D bb = data.boundingBox();
- QCOMPARE(bb.maximum(), d);
- QCOMPARE(bb.minimum(), a);
-}
-
-void tst_QGeometryData::center()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
-
- QVector3D center = data.center();
- QCOMPARE(center, QVector3D(2.6, 2.7, 2.8));
-}
-
-void tst_QGeometryData::normalizeNormals()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- data.normalizeNormals();
- QVERIFY(qFskCompare(data.normalAt(0), QVector3D(0.566178, 0.577279, 0.588381)));
- QVERIFY(qFskCompare(data.normalAt(1), QVector3D(0.567989, 0.577300, 0.586612)));
- QVERIFY(qFskCompare(data.normalAt(2), QVector3D(0.569295, 0.577313, 0.585331)));
- QVERIFY(qFskCompare(data.normalAt(3), QVector3D(0.570281, 0.577322, 0.584362)));
- QVERIFY(qFskCompare(data.normalAt(0).lengthSquared(), qreal(1.0f)));
- QVERIFY(qFskCompare(data.normalAt(1).lengthSquared(), qreal(1.0f)));
- QVERIFY(qFskCompare(data.normalAt(2).lengthSquared(), qreal(1.0f)));
- QVERIFY(qFskCompare(data.normalAt(3).lengthSquared(), qreal(1.0f)));
-}
-
-void tst_QGeometryData::reversed()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- QGeometryData reversed = data.reversed();
-
- QCOMPARE(data.vertexAt(0), reversed.vertexAt(3));
- QCOMPARE(data.vertexAt(1), reversed.vertexAt(2));
- QCOMPARE(data.vertexAt(2), reversed.vertexAt(1));
- QCOMPARE(data.vertexAt(3), reversed.vertexAt(0));
- QCOMPARE(data.normalAt(0), reversed.normalAt(3));
- QCOMPARE(data.normalAt(1), reversed.normalAt(2));
- QCOMPARE(data.normalAt(2), reversed.normalAt(1));
- QCOMPARE(data.normalAt(3), reversed.normalAt(0));
-}
-
-void tst_QGeometryData::translated()
-{
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- QVector3D t(0.5, -0.5, -0.5);
- QGeometryData translated = data.translated(t);
-
- QVector3D at = a + t;
- QVector3D bt = b + t;
- QVector3D ct = c + t;
- QVector3D dt = d + t;
-
- QCOMPARE(at, translated.vertexAt(0));
- QCOMPARE(bt, translated.vertexAt(1));
- QCOMPARE(ct, translated.vertexAt(2));
- QCOMPARE(dt, translated.vertexAt(3));
- QCOMPARE(an, translated.normalAt(0));
- QCOMPARE(bn, translated.normalAt(1));
- QCOMPARE(cn, translated.normalAt(2));
- QCOMPARE(dn, translated.normalAt(3));
-}
-
-void tst_QGeometryData::generateTextureCoordinates()
-{
- QGeometryData top;
-
- top.appendVertex(QVector3D(0.0, 0.0, 0.0));
- top.appendVertex(QVector3D(6.0, 3.6, 0.0)); // (v1 - v0).length() = 7.0
- top.appendVertex(QVector3D(10.0, 0.6, 0.0)); // (v2 - v1).length() = 5.0
- top.appendVertex(QVector3D(13.0, 3.24, 0.0)); // (v3 - v2).length() = 4.0
-
- // generate x (Qt::Horizontal) texture coordinates
- top.generateTextureCoordinates(); // spread over 7 + 5 + 4 = 16
-
- QVERIFY(qFskCompare(top.texCoordAt(0), QVector2D()));
- QVERIFY(qFskCompare(top.texCoordAt(1), QVector2D(0.43750349, 0.0)));
- QVERIFY(qFskCompare(top.texCoordAt(2), QVector2D(0.75013363, 0.0)));
- QVERIFY(qFskCompare(top.texCoordAt(3), QVector2D(1.0, 0.0)));
-
- QGeometryData side;
-
- side.appendVertex(QVector3D(0.0, 0.0, 0.0));
- side.appendVertex(QVector3D(3.6, 6.0, 0.0)); // (v1 - v0).length() = 7.0
- side.appendVertex(QVector3D(0.6, 10.0, 0.0)); // (v2 - v1).length() = 5.0
- side.appendVertex(QVector3D(3.24, 13.0, 0.0)); // (v3 - v2).length() = 4.0
-
- // generate x (Qt::Vertical) texture coordinates
- side.generateTextureCoordinates(Qt::Vertical); // spread over 7 + 5 + 4 = 16
-
- QVERIFY(qFskCompare(side.texCoordAt(0), QVector2D()));
- QVERIFY(qFskCompare(side.texCoordAt(1), QVector2D(0.0, 0.43750349)));
- QVERIFY(qFskCompare(side.texCoordAt(2), QVector2D(0.0, 0.75013363)));
- QVERIFY(qFskCompare(side.texCoordAt(3), QVector2D(0.0, 1.0)));
-}
-
-void tst_QGeometryData::clear()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- quint32 f = data.fields();
- quint32 expectedFields = QGL::fieldMask(QGL::Normal) | QGL::fieldMask(QGL::Position);
- QCOMPARE(f, expectedFields);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.count(QGL::Normal), 4);
- QCOMPARE(data.count(QGL::Position), 4);
-
- data.clear();
- QCOMPARE(f, expectedFields);
- QCOMPARE(data.count(), 0);
- QCOMPARE(data.count(QGL::Normal), 0);
- QCOMPARE(data.count(QGL::Position), 0);
-
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- data.clear(QGL::Normal);
-
- f = data.fields();
- expectedFields = QGL::fieldMask(QGL::Position);
- QCOMPARE(f, expectedFields);
- QCOMPARE(data.count(), 4);
- QCOMPARE(data.count(QGL::Normal), 0);
- QCOMPARE(data.count(QGL::Position), 4);
-}
-
-void tst_QGeometryData::draw()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- QVector3D a(1.1, 1.2, 1.3);
- QVector3D b(2.1, 2.2, 2.3);
- QVector3D c(3.1, 3.2, 3.3);
- QVector3D d(4.1, 4.2, 4.3);
- QVector3D an(5.1, 5.2, 5.3);
- QVector3D bn(6.1, 6.2, 6.3);
- QVector3D cn(7.1, 7.2, 7.3);
- QVector3D dn(8.1, 8.2, 8.3);
-
- QGeometryData data;
- data.appendVertex(a, b, c, d);
- data.appendNormal(an, bn, cn, dn);
-
- QGLView w;
- QGLPainter p(&w);
- data.draw(&p, 0, 4);
-}
-
-
-QTEST_MAIN(tst_QGeometryData)
-
-#include "tst_qgeometrydata.moc"
diff --git a/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro b/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro
deleted file mode 100644
index 887e9b76..00000000
--- a/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglabstractsurface
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglabstractsurface.cpp
-QT += widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp b/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp
deleted file mode 100644
index a5d100ea..00000000
--- a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglabstractsurface.h"
-#include "qglwindowsurface.h"
-#include "qglframebufferobjectsurface.h"
-#include "qglpixelbuffersurface.h"
-#include "qglsubsurface.h"
-#include "qopenglfunctions.h"
-
-#include <QtGui/QOpenGLContext>
-
-class tst_QGLAbstractSurface : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLAbstractSurface() {}
- ~tst_QGLAbstractSurface() {}
-
-private slots:
- void glWindowSurface();
- void fboSurface();
- // TODO: void pbufferSurface();
- void subSurface();
-
-private:
- bool isFboCurrent(QOpenGLFramebufferObject *fbo);
-};
-
-bool tst_QGLAbstractSurface::isFboCurrent(QOpenGLFramebufferObject *fbo)
-{
- GLint currentFbo = -1;
- glGetIntegerv(GL_FRAMEBUFFER_BINDING, &currentFbo);
- if (currentFbo == -1)
- return true; // XXX: Mesa 7.0.3 bug?
- if (fbo)
- return fbo->handle() == GLuint(currentFbo);
- else
- return currentFbo == 0;
-}
-
-static void ensureContext(QWindow &win, QOpenGLContext &ctx)
-{
- QSurfaceFormat format;
- format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
- ctx.setFormat(format);
-#ifndef QT_NO_DEBUG_STREAM
- QSurfaceFormat oldFormat = format;
-#endif
- ctx.create();
- // TODO: is it possible that the platform will downgrade the actual
- // format, or will it just fail if it can't deliver the actual format
- format = ctx.format();
-#ifndef QT_NO_DEBUG_STREAM
- if (oldFormat.swapBehavior() != format.swapBehavior())
- qWarning() << "Could not create context for swap behavior"
- << oldFormat.swapBehavior();
-#endif
- ctx.makeCurrent(&win);
-}
-
-void tst_QGLAbstractSurface::glWindowSurface()
-{
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLWindowSurface surface1;
- QVERIFY(surface1.surfaceType() == QGLAbstractSurface::Window);
- QVERIFY(surface1.window() == 0);
- surface1.setWindow(&glw);
- QVERIFY(surface1.window() == &glw);
- QCOMPARE(surface1.viewportRect(), glw.geometry());
-
- QVERIFY(surface1.activate());
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- surface1.deactivate();
- QVERIFY(QOpenGLContext::currentContext() == &ctx); // Left current.
-
- QWindow glw2;
- glw2.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx2;
- ensureContext(glw2, ctx2);
-
- QGLWindowSurface surface2(&glw2);
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::Window);
- QVERIFY(surface2.window() == &glw2);
-
- QVERIFY(surface1.activate());
- QVERIFY(surface1.switchTo(&surface2));
-
- QVERIFY(QOpenGLContext::currentContext() == &ctx2);
-
- QVERIFY(surface2.switchTo(&surface1));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
-}
-
-void tst_QGLAbstractSurface::fboSurface()
-{
- if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
- QSKIP("fbo's are not supported");
-
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLWindowSurface surface1(&glw);
- QVERIFY(surface1.activate());
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- QOpenGLFramebufferObject fbo1(128, 128);
- QVERIFY(fbo1.handle() != 0);
-
- QGLFramebufferObjectSurface surface2(&fbo1);
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::FramebufferObject);
- QVERIFY(surface2.framebufferObject() == &fbo1);
-
- QVERIFY(isFboCurrent(0));
-
- QVERIFY(surface2.activate());
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- surface2.deactivate();
- QVERIFY(isFboCurrent(0));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
-
- surface2.setContext(&ctx);
-
- QWindow glw2;
- glw2.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx2;
- ensureContext(glw2, ctx2);
-
- QGLWindowSurface surface3(&glw2);
- QVERIFY(surface3.activate());
- QVERIFY(QOpenGLContext::currentContext() == &ctx2);
- QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height()));
-
- QVERIFY(surface3.switchTo(&surface2));
- QVERIFY(isFboCurrent(&fbo1));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface3));
- QVERIFY(isFboCurrent(0));
- QVERIFY(QOpenGLContext::currentContext() == &ctx2);
- QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height()));
-
- surface3.deactivate();
-
- surface1.activate();
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- QOpenGLFramebufferObject fbo2(256, 256);
- QVERIFY(fbo2.handle() != 0);
-
- QGLFramebufferObjectSurface surface4;
- QVERIFY(surface4.surfaceType() == QGLAbstractSurface::FramebufferObject);
- QVERIFY(surface4.framebufferObject() == 0);
- QVERIFY(!surface4.activate(0));
- QVERIFY(surface4.viewportGL().isNull());
- surface4.setFramebufferObject(&fbo2);
- QVERIFY(surface4.framebufferObject() == &fbo2);
- surface4.setContext(&ctx);
-
- QVERIFY(surface1.switchTo(&surface2));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface4));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QVERIFY(isFboCurrent(&fbo2));
- QCOMPARE(surface4.viewportGL(), QRect(QPoint(0, 0), fbo2.size()));
-
- QVERIFY(surface3.switchTo(&surface2));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface1));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QVERIFY(isFboCurrent(0));
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-}
-
-/*
-void tst_QGLAbstractSurface::pbufferSurface()
-{
- if (!QGLPixelBuffer::hasOpenGLPbuffers())
- QSKIP("pbuffer's are not supported");
-
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLWindowSurface surface1(&glw);
- QVERIFY(surface1.activate());
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- QGLPixelBuffer pbuffer1(128, 128);
- QVERIFY(pbuffer1.handle() != 0);
-
- QGLPixelBufferSurface surface2(&pbuffer1);
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::PixelBuffer);
- QVERIFY(surface2.pixelBuffer() == &pbuffer1);
- QVERIFY(surface2.device() == &pbuffer1);
-
- QVERIFY(surface2.activate());
- QVERIFY(QGLContext::currentContext() != glw.context());
- const QGLContext *surface2ctx = QGLContext::currentContext();
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size()));
-
- surface2.deactivate();
- QVERIFY(QGLContext::currentContext() == surface2ctx); // Left current.
-
- QGLWidget glw2;
- QGLWindowSurface surface3(&glw2);
- QVERIFY(surface3.activate());
- QVERIFY(QGLContext::currentContext() == glw2.context());
- QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height()));
-
- QVERIFY(surface3.switchTo(&surface2));
- QVERIFY(QGLContext::currentContext() == surface2ctx);
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size()));
-
- QVERIFY(surface2.switchTo(&surface3));
- QVERIFY(QGLContext::currentContext() == glw2.context());
- QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height()));
-
- surface3.deactivate();
-
- surface1.activate();
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- QGLPixelBuffer pbuffer2(256, 256);
- QVERIFY(pbuffer2.handle() != 0);
-
- QGLPixelBufferSurface surface4;
- QVERIFY(surface4.surfaceType() == QGLAbstractSurface::PixelBuffer);
- QVERIFY(surface4.pixelBuffer() == 0);
- QVERIFY(surface4.device() == 0);
- QVERIFY(!surface4.activate(0));
- QVERIFY(surface4.viewportGL().isNull());
- surface4.setPixelBuffer(&pbuffer2);
- QVERIFY(surface4.pixelBuffer() == &pbuffer2);
- QVERIFY(surface4.device() == &pbuffer2);
-
- QVERIFY(surface1.switchTo(&surface2));
- QVERIFY(QGLContext::currentContext() == surface2ctx);
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size()));
-
- QVERIFY(surface2.switchTo(&surface4));
- const QGLContext *surface4ctx = QGLContext::currentContext();
- QVERIFY(surface4ctx != glw.context());
- QVERIFY(surface4ctx != surface2ctx);
- QCOMPARE(surface4.viewportGL(), QRect(QPoint(0, 0), pbuffer2.size()));
-
- QVERIFY(surface4.switchTo(&surface2));
- QVERIFY(QGLContext::currentContext() == surface2ctx);
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size()));
-
- QVERIFY(surface2.switchTo(&surface1));
- QVERIFY(QGLContext::currentContext() == glw.context());
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-}
-*/
-void tst_QGLAbstractSurface::subSurface()
-{
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLWindowSurface surface1(&glw);
-
- QGLSubsurface surface2(&surface1, QRect(0, 0, 32, 16));
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::Subsurface);
- QVERIFY(surface2.surface() == &surface1);
- QCOMPARE(surface2.region(), QRect(0, 0, 32, 16));
-
- QVERIFY(surface2.activate());
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QCOMPARE(surface2.viewportGL(), QRect(0, glw.height() - 16, 32, 16));
-
- QGLSubsurface surface3(&surface1, QRect(16, 8, 32, 16));
- QVERIFY(surface3.surfaceType() == QGLAbstractSurface::Subsurface);
- QVERIFY(surface3.surface() == &surface1);
- QCOMPARE(surface3.region(), QRect(16, 8, 32, 16));
-
- QVERIFY(surface2.switchTo(&surface3));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QCOMPARE(surface3.viewportGL(), QRect(16, glw.height() - (8 + 16), 32, 16));
-
- QGLSubsurface surface4;
- QVERIFY(surface4.surfaceType() == QGLAbstractSurface::Subsurface);
- QVERIFY(surface4.surface() == 0);
- QVERIFY(surface4.region().isNull());
- QVERIFY(!surface4.activate(0));
- surface4.setRegion(QRect(4, 6, 12, 8));
- QCOMPARE(surface4.viewportGL(), QRect(4, 0, 12, 8));
- surface4.setSurface(&surface3);
- QVERIFY(surface4.surface() == &surface3);
- QCOMPARE(surface4.region(), QRect(4, 6, 12, 8));
-
- QVERIFY(surface2.switchTo(&surface4));
- QVERIFY(QOpenGLContext::currentContext() == &ctx);
- QCOMPARE(surface4.viewportGL(), QRect(16 + 4, glw.height() - (6 + 8 + 8), 12, 8));
-}
-
-QTEST_MAIN(tst_QGLAbstractSurface)
-
-#include "tst_qglabstractsurface.moc"
diff --git a/tests/auto/threed/qglattributedescription/qglattributedescription.pro b/tests/auto/threed/qglattributedescription/qglattributedescription.pro
deleted file mode 100644
index 17071c6f..00000000
--- a/tests/auto/threed/qglattributedescription/qglattributedescription.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglattributedescription
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../threed/viewing
-VPATH += ../../../../threed/viewing
-
-SOURCES += tst_qglattributedescription.cpp
diff --git a/tests/auto/threed/qglattributedescription/tst_qglattributedescription.cpp b/tests/auto/threed/qglattributedescription/tst_qglattributedescription.cpp
deleted file mode 100644
index b8c92e26..00000000
--- a/tests/auto/threed/qglattributedescription/tst_qglattributedescription.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglattributedescription.h"
-#include "qopenglfunctions.h"
-
-class tst_QGLAttributeDescription : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLAttributeDescription() {}
- ~tst_QGLAttributeDescription() {}
-
-private slots:
- void defaultValue();
- void explicitValue();
- void modifyValue();
- void typeSizes();
-};
-
-void tst_QGLAttributeDescription::defaultValue()
-{
- QGLAttributeDescription desc;
- QVERIFY(desc.isNull());
- QVERIFY(desc.attribute() == QGL::Position);
- QVERIFY(desc.type() == GL_FLOAT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(desc.tupleSize(), 0);
- QCOMPARE(desc.stride(), 0);
-}
-
-void tst_QGLAttributeDescription::explicitValue()
-{
- QGLAttributeDescription desc(QGL::Color, 4, GL_UNSIGNED_BYTE, 20);
- QVERIFY(!desc.isNull());
- QVERIFY(desc.attribute() == QGL::Color);
- QVERIFY(desc.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(desc.tupleSize(), 4);
- QCOMPARE(desc.stride(), 20);
-}
-
-void tst_QGLAttributeDescription::modifyValue()
-{
- QGLAttributeDescription desc;
- desc.setAttribute(QGL::Color);
- desc.setType(GL_UNSIGNED_BYTE);
- desc.setTupleSize(4);
- desc.setStride(20);
- QVERIFY(!desc.isNull());
- QVERIFY(desc.attribute() == QGL::Color);
- QVERIFY(desc.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(desc.tupleSize(), 4);
- QCOMPARE(desc.stride(), 20);
-}
-
-void tst_QGLAttributeDescription::typeSizes()
-{
- QGLAttributeDescription desc;
-
- desc.setType(GL_BYTE);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLbyte)));
-
- desc.setType(GL_UNSIGNED_BYTE);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLubyte)));
-
- desc.setType(GL_SHORT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLshort)));
-
- desc.setType(GL_UNSIGNED_SHORT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLushort)));
-
- desc.setType(GL_INT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLint)));
-
- desc.setType(GL_UNSIGNED_INT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLuint)));
-
- desc.setType(GL_FLOAT);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLfloat)));
-
-#if defined(GL_DOUBLE) && !defined(QT_OPENGL_ES)
- desc.setType(GL_DOUBLE);
- QCOMPARE(desc.sizeOfType(), int(sizeof(GLdouble)));
-#endif
-
- desc.setType(GL_TEXTURE0); // Something that isn't a GL type.
- QCOMPARE(desc.sizeOfType(), 0);
-
- QVERIFY(desc.isNull());
- desc.setTupleSize(3);
- QVERIFY(!desc.isNull());
-}
-
-QTEST_APPLESS_MAIN(tst_QGLAttributeDescription)
-
-#include "tst_qglattributedescription.moc"
diff --git a/tests/auto/threed/qglattributeset/qglattributeset.pro b/tests/auto/threed/qglattributeset/qglattributeset.pro
deleted file mode 100644
index fc80c846..00000000
--- a/tests/auto/threed/qglattributeset/qglattributeset.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qglattributeset
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglattributeset.cpp
diff --git a/tests/auto/threed/qglattributeset/tst_qglattributeset.cpp b/tests/auto/threed/qglattributeset/tst_qglattributeset.cpp
deleted file mode 100644
index 33365fd8..00000000
--- a/tests/auto/threed/qglattributeset/tst_qglattributeset.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglattributeset.h"
-
-class tst_QGLAttributeSet : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLAttributeSet() {}
- ~tst_QGLAttributeSet() {}
-
-private slots:
- void defaultValue();
- void clear();
- void insert();
- void remove();
- void list();
- void compare();
- void unite();
- void intersect();
- void subtract();
-};
-
-void tst_QGLAttributeSet::defaultValue()
-{
- QGLAttributeSet set;
- QVERIFY(set.isEmpty());
- for (int index = -50; index <= 50; ++index)
- QVERIFY(!set.contains(QGL::VertexAttribute(index)));
-}
-
-void tst_QGLAttributeSet::clear()
-{
- QGLAttributeSet set;
- set.insert(QGL::TextureCoord0);
- QVERIFY(!set.isEmpty());
- QVERIFY(set.contains(QGL::TextureCoord0));
- set.clear();
- QVERIFY(set.isEmpty());
- QVERIFY(!set.contains(QGL::TextureCoord0));
-}
-
-void tst_QGLAttributeSet::insert()
-{
- QSKIP("Fails on Qt5");
-
- for (int index = -50; index <= 50; ++index) {
- QGLAttributeSet set;
- set.insert(QGL::VertexAttribute(index));
- if (index < 0 || index > 31)
- QVERIFY(!set.contains(QGL::VertexAttribute(index)));
- else
- QVERIFY(set.contains(QGL::VertexAttribute(index)));
- for (int index2 = -50; index2 <= 50; ++index2) {
- if (index2 != index)
- QVERIFY(!set.contains(QGL::VertexAttribute(index2)));
- }
- }
-}
-
-void tst_QGLAttributeSet::remove()
-{
- for (int index = -50; index <= 50; ++index) {
- QGLAttributeSet set;
- for (int index2 = 0; index2 < 32; ++index2)
- set.insert(QGL::VertexAttribute(index2));
- set.remove(QGL::VertexAttribute(index));
- for (int index2 = 0; index2 < 32; ++index2) {
- if (index == index2)
- QVERIFY(!set.contains(QGL::VertexAttribute(index2)));
- else
- QVERIFY(set.contains(QGL::VertexAttribute(index2)));
- }
- }
-}
-
-void tst_QGLAttributeSet::list()
-{
- QList<QGL::VertexAttribute> list;
- QVERIFY(QGLAttributeSet::fromList(list).isEmpty());
-
- list.append(QGL::VertexAttribute(-50));
- list.append(QGL::TextureCoord1);
- list.append(QGL::VertexAttribute(50));
-
- QGLAttributeSet set1 = QGLAttributeSet::fromList(list);
- QGLAttributeSet set2;
- set2.insert(QGL::TextureCoord1);
- QVERIFY(set1 == set2);
-
- QList<QGL::VertexAttribute> list2 = set1.toList();
- QCOMPARE(list2.count(), 1);
- QVERIFY(list2[0] == QGL::TextureCoord1);
-}
-
-void tst_QGLAttributeSet::compare()
-{
- QGLAttributeSet set1;
- QGLAttributeSet set2;
-
- QVERIFY(set1 == set2);
- QVERIFY(!(set1 != set2));
-
- set1.insert(QGL::Position);
- QVERIFY(set1 != set2);
- QVERIFY(!(set1 == set2));
-
- set2.insert(QGL::Position);
- QVERIFY(set1 == set2);
- QVERIFY(!(set1 != set2));
-
- set2.insert(QGL::TextureCoord0);
- QVERIFY(set1 != set2);
- QVERIFY(!(set1 == set2));
-}
-
-void tst_QGLAttributeSet::unite()
-{
- QGLAttributeSet set1;
- QGLAttributeSet set2;
-
- set1.insert(QGL::Position);
- set1.insert(QGL::Color);
-
- set2.insert(QGL::Position);
- set2.insert(QGL::TextureCoord0);
-
- set1.unite(set2);
- QVERIFY(set1.contains(QGL::Position));
- QVERIFY(set1.contains(QGL::Color));
- QVERIFY(set1.contains(QGL::TextureCoord0));
- QVERIFY(!set1.contains(QGL::Normal));
-}
-
-void tst_QGLAttributeSet::intersect()
-{
- QGLAttributeSet set1;
- QGLAttributeSet set2;
-
- set1.insert(QGL::Position);
- set1.insert(QGL::Color);
-
- set2.insert(QGL::Position);
- set2.insert(QGL::TextureCoord0);
-
- set1.intersect(set2);
- QVERIFY(set1.contains(QGL::Position));
- QVERIFY(!set1.contains(QGL::Color));
- QVERIFY(!set1.contains(QGL::TextureCoord0));
- QVERIFY(!set1.contains(QGL::Normal));
-}
-
-void tst_QGLAttributeSet::subtract()
-{
- QGLAttributeSet set1;
- QGLAttributeSet set2;
-
- set1.insert(QGL::Position);
- set1.insert(QGL::Color);
-
- set2.insert(QGL::Position);
- set2.insert(QGL::TextureCoord0);
-
- set1.subtract(set2);
- QVERIFY(!set1.contains(QGL::Position));
- QVERIFY(set1.contains(QGL::Color));
- QVERIFY(!set1.contains(QGL::TextureCoord0));
- QVERIFY(!set1.contains(QGL::Normal));
-}
-
-QTEST_APPLESS_MAIN(tst_QGLAttributeSet)
-
-#include "tst_qglattributeset.moc"
diff --git a/tests/auto/threed/qglattributevalue/qglattributevalue.pro b/tests/auto/threed/qglattributevalue/qglattributevalue.pro
deleted file mode 100644
index 055457e7..00000000
--- a/tests/auto/threed/qglattributevalue/qglattributevalue.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglattributevalue
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../threed/viewing
-VPATH += ../../../../threed/viewing
-
-SOURCES += tst_qglattributevalue.cpp
diff --git a/tests/auto/threed/qglattributevalue/tst_qglattributevalue.cpp b/tests/auto/threed/qglattributevalue/tst_qglattributevalue.cpp
deleted file mode 100644
index 69988b48..00000000
--- a/tests/auto/threed/qglattributevalue/tst_qglattributevalue.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglattributevalue.h"
-#include "qopenglfunctions.h"
-
-class tst_QGLAttributeValue : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLAttributeValue() {}
- ~tst_QGLAttributeValue() {}
-
-private slots:
- void defaultValue();
- void explicitValue();
- void fromArray();
- void typeSizes_data();
- void typeSizes();
-};
-
-void tst_QGLAttributeValue::defaultValue()
-{
- QGLAttributeValue value;
- QVERIFY(value.isNull());
- QVERIFY(value.description(QGL::Normal).isNull());
- QVERIFY(value.description(QGL::Normal).attribute() == QGL::Normal);
- QVERIFY(value.type() == GL_FLOAT);
- QCOMPARE(value.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(value.tupleSize(), 0);
- QCOMPARE(value.stride(), 0);
- QVERIFY(value.data() == 0);
- QCOMPARE(value.count(), 0);
-}
-
-void tst_QGLAttributeValue::explicitValue()
-{
- unsigned char data[4] = {1, 2, 3, 4};
- QGLAttributeValue value(4, GL_UNSIGNED_BYTE, 20, data, 1);
- QVERIFY(!value.isNull());
- QVERIFY(value.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(value.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(value.tupleSize(), 4);
- QCOMPARE(value.stride(), 20);
- QVERIFY(value.data() == data);
- QCOMPARE(value.count(), 1);
- QVERIFY(!value.description(QGL::Color).isNull());
- QVERIFY(value.description(QGL::Color).attribute() == QGL::Color);
-
- QGLAttributeValue value2(4, GL_UNSIGNED_BYTE, 20, 23, 1);
- QVERIFY(!value2.isNull());
- QVERIFY(value2.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(value2.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(value2.tupleSize(), 4);
- QCOMPARE(value2.stride(), 20);
- QVERIFY(value2.data() == reinterpret_cast<const void *>(23));
- QCOMPARE(value2.count(), 1);
-
- QGLAttributeDescription desc(QGL::Color, 4, GL_UNSIGNED_BYTE, 20);
- QGLAttributeValue value3(desc, data, 1);
- QVERIFY(!value3.isNull());
- QVERIFY(value3.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(value3.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(value3.tupleSize(), 4);
- QCOMPARE(value3.stride(), 20);
- QVERIFY(value3.data() == data);
- QCOMPARE(value3.count(), 1);
-
- QGLAttributeValue value4(desc, 23, 1);
- QVERIFY(!value4.isNull());
- QVERIFY(value4.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(value4.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(value4.tupleSize(), 4);
- QCOMPARE(value4.stride(), 20);
- QVERIFY(value4.data() == reinterpret_cast<const void *>(23));
- QCOMPARE(value4.count(), 1);
-}
-
-void tst_QGLAttributeValue::fromArray()
-{
- QArray<float> floatArray;
- floatArray += 1.0f;
- floatArray += 2.0f;
- floatArray += 3.0f;
- floatArray += 4.0f;
- QGLAttributeValue valueFloat(floatArray);
- QVERIFY(!valueFloat.isNull());
- QVERIFY(valueFloat.type() == GL_FLOAT);
- QCOMPARE(valueFloat.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueFloat.tupleSize(), 1);
- QCOMPARE(valueFloat.stride(), 0);
- QVERIFY(valueFloat.data() == floatArray.constData());
- QCOMPARE(valueFloat.count(), floatArray.count());
-
- QCustomDataArray floatCustomArray(floatArray);
- QGLAttributeValue valueFloatCustom(floatCustomArray);
- QVERIFY(!valueFloatCustom.isNull());
- QVERIFY(valueFloatCustom.type() == GL_FLOAT);
- QCOMPARE(valueFloatCustom.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueFloatCustom.tupleSize(), 1);
- QCOMPARE(valueFloatCustom.stride(), 0);
- QVERIFY(valueFloatCustom.data() == floatCustomArray.data());
- QCOMPARE(valueFloatCustom.count(), floatCustomArray.count());
-
- QArray<QVector2D> vec2Array;
- vec2Array += QVector2D(1.0f, 2.0f);
- vec2Array += QVector2D(2.0f, 3.0f);
- QGLAttributeValue valueVec2(vec2Array);
- QVERIFY(!valueVec2.isNull());
- QVERIFY(valueVec2.type() == GL_FLOAT);
- QCOMPARE(valueVec2.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec2.tupleSize(), 2);
- QCOMPARE(valueVec2.stride(), 0);
- QVERIFY(valueVec2.data() == vec2Array.constData());
- QCOMPARE(valueVec2.count(), vec2Array.count());
-
- QCustomDataArray vec2CustomArray(vec2Array);
- QGLAttributeValue valueVec2Custom(vec2CustomArray);
- QVERIFY(!valueVec2Custom.isNull());
- QVERIFY(valueVec2Custom.type() == GL_FLOAT);
- QCOMPARE(valueVec2Custom.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec2Custom.tupleSize(), 2);
- QCOMPARE(valueVec2Custom.stride(), 0);
- QVERIFY(valueVec2Custom.data() == vec2CustomArray.data());
- QCOMPARE(valueVec2Custom.count(), vec2CustomArray.count());
-
- QArray<QVector3D> vec3Array;
- vec3Array += QVector3D(1.0f, 2.0f, 3.0f);
- vec3Array += QVector3D(2.0f, 3.0f, 4.0f);
- QGLAttributeValue valueVec3(vec3Array);
- QVERIFY(!valueVec3.isNull());
- QVERIFY(valueVec3.type() == GL_FLOAT);
- QCOMPARE(valueVec3.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec3.tupleSize(), 3);
- QCOMPARE(valueVec3.stride(), 0);
- QVERIFY(valueVec3.data() == vec3Array.constData());
- QCOMPARE(valueVec3.count(), vec3Array.count());
-
- QCustomDataArray vec3CustomArray(vec3Array);
- QGLAttributeValue valueVec3Custom(vec3CustomArray);
- QVERIFY(!valueVec3Custom.isNull());
- QVERIFY(valueVec3Custom.type() == GL_FLOAT);
- QCOMPARE(valueVec3Custom.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec3Custom.tupleSize(), 3);
- QCOMPARE(valueVec3Custom.stride(), 0);
- QVERIFY(valueVec3Custom.data() == vec3CustomArray.data());
- QCOMPARE(valueVec3Custom.count(), vec3CustomArray.count());
-
- QArray<QVector4D> vec4Array;
- vec4Array += QVector4D(1.0f, 2.0f, 3.0f, 4.0f);
- vec4Array += QVector4D(2.0f, 3.0f, 4.0f, 5.0f);
- QGLAttributeValue valueVec4(vec4Array);
- QVERIFY(!valueVec4.isNull());
- QVERIFY(valueVec4.type() == GL_FLOAT);
- QCOMPARE(valueVec4.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec4.tupleSize(), 4);
- QCOMPARE(valueVec4.stride(), 0);
- QVERIFY(valueVec4.data() == vec4Array.constData());
- QCOMPARE(valueVec4.count(), vec4Array.count());
-
- QCustomDataArray vec4CustomArray(vec4Array);
- QGLAttributeValue valueVec4Custom(vec4CustomArray);
- QVERIFY(!valueVec4Custom.isNull());
- QVERIFY(valueVec4Custom.type() == GL_FLOAT);
- QCOMPARE(valueVec4Custom.sizeOfType(), int(sizeof(GLfloat)));
- QCOMPARE(valueVec4Custom.tupleSize(), 4);
- QCOMPARE(valueVec4Custom.stride(), 0);
- QVERIFY(valueVec4Custom.data() == vec4CustomArray.data());
- QCOMPARE(valueVec4Custom.count(), vec4CustomArray.count());
-
- QArray<QColor4ub> colorArray;
- colorArray += QColor4ub(1, 2, 3, 4);
- colorArray += QColor4ub(2, 3, 4, 5);
- QGLAttributeValue valueColor(colorArray);
- QVERIFY(!valueColor.isNull());
- QVERIFY(valueColor.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(valueColor.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(valueColor.tupleSize(), 4);
- QCOMPARE(valueColor.stride(), 0);
- QVERIFY(valueColor.data() == colorArray.constData());
- QCOMPARE(valueColor.count(), colorArray.count());
-
- QCustomDataArray colorCustomArray(colorArray);
- QGLAttributeValue valueColorCustom(colorCustomArray);
- QVERIFY(!valueColorCustom.isNull());
- QVERIFY(valueColorCustom.type() == GL_UNSIGNED_BYTE);
- QCOMPARE(valueColorCustom.sizeOfType(), int(sizeof(GLubyte)));
- QCOMPARE(valueColorCustom.tupleSize(), 4);
- QCOMPARE(valueColorCustom.stride(), 0);
- QVERIFY(valueColorCustom.data() == colorCustomArray.data());
- QCOMPARE(valueColorCustom.count(), colorCustomArray.count());
-}
-
-void tst_QGLAttributeValue::typeSizes_data()
-{
- QTest::addColumn<int>("type");
- QTest::addColumn<int>("size");
-
- QTest::newRow("byte") << int(GL_BYTE) << int(sizeof(GLbyte));
- QTest::newRow("ubyte") << int(GL_UNSIGNED_BYTE) << int(sizeof(GLubyte));
- QTest::newRow("short") << int(GL_SHORT) << int(sizeof(GLshort));
- QTest::newRow("ushort") << int(GL_UNSIGNED_SHORT) << int(sizeof(GLushort));
- QTest::newRow("int") << int(GL_INT) << int(sizeof(GLint));
- QTest::newRow("uint") << int(GL_UNSIGNED_INT) << int(sizeof(GLuint));
- QTest::newRow("float") << int(GL_FLOAT) << int(sizeof(GLfloat));
-#if defined(GL_DOUBLE) && !defined(QT_OPENGL_ES)
- QTest::newRow("double") << int(GL_DOUBLE) << int(sizeof(GLdouble));
-#endif
- QTest::newRow("non-type") << int(GL_TEXTURE0) << int(0);
-}
-
-void tst_QGLAttributeValue::typeSizes()
-{
- QFETCH(int, type);
- QFETCH(int, size);
-
- QGLAttributeValue value(4, GLenum(type), 0, 0);
- QCOMPARE(value.sizeOfType(), size);
-}
-
-QTEST_APPLESS_MAIN(tst_QGLAttributeValue)
-
-#include "tst_qglattributevalue.moc"
diff --git a/tests/auto/threed/qglbezierpatches/qglbezierpatches.pro b/tests/auto/threed/qglbezierpatches/qglbezierpatches.pro
deleted file mode 100644
index 282259f5..00000000
--- a/tests/auto/threed/qglbezierpatches/qglbezierpatches.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qglbezierpatches
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglbezierpatches.cpp
diff --git a/tests/auto/threed/qglbezierpatches/tst_qglbezierpatches.cpp b/tests/auto/threed/qglbezierpatches/tst_qglbezierpatches.cpp
deleted file mode 100644
index 089afc84..00000000
--- a/tests/auto/threed/qglbezierpatches/tst_qglbezierpatches.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglbezierpatches.h"
-#include "qglbuilder.h"
-#include "qglteapot.h"
-
-class tst_QGLBezierPatches : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLBezierPatches() {}
- ~tst_QGLBezierPatches() {}
-
-private slots:
- void defaultValue();
- void modify();
- void teapot();
- void build();
- void transform();
-};
-
-void tst_QGLBezierPatches::defaultValue()
-{
- QGLBezierPatches patches;
- QVERIFY(patches.positions().isEmpty());
- QVERIFY(patches.textureCoords().isEmpty());
- QCOMPARE(patches.subdivisionDepth(), 4);
-}
-
-void tst_QGLBezierPatches::modify()
-{
- QVector3DArray positions;
- for (int index = 0; index < 32; ++index)
- positions.append(index, index + 1, index + 2);
-
- QVector2DArray texCoords;
- texCoords.append(0.0f, 0.5f);
- texCoords.append(0.5f, 1.0f);
- texCoords.append(0.5f, 0.0f);
- texCoords.append(1.0f, 0.5f);
-
- QGLBezierPatches patches;
- patches.setPositions(positions);
- patches.setTextureCoords(texCoords);
- patches.setSubdivisionDepth(23);
-
- QCOMPARE(patches.positions().size(), positions.size());
- QVERIFY(patches.positions() == positions);
- QCOMPARE(patches.textureCoords().size(), texCoords.size());
- QVERIFY(patches.textureCoords() == texCoords);
- QCOMPARE(patches.subdivisionDepth(), 23);
-
- QGLBezierPatches patches2(patches);
- QCOMPARE(patches2.positions().size(), positions.size());
- QVERIFY(patches2.positions() == positions);
- QCOMPARE(patches2.textureCoords().size(), texCoords.size());
- QVERIFY(patches2.textureCoords() == texCoords);
- QCOMPARE(patches2.subdivisionDepth(), 23);
-
- patches2.setPositions(QVector3DArray());
- patches2.setTextureCoords(QVector2DArray());
- patches2.setSubdivisionDepth(18);
-
- QCOMPARE(patches.positions().size(), positions.size());
- QVERIFY(patches.positions() == positions);
- QCOMPARE(patches.textureCoords().size(), texCoords.size());
- QVERIFY(patches.textureCoords() == texCoords);
- QCOMPARE(patches.subdivisionDepth(), 23);
-
- QVERIFY(patches2.positions().isEmpty());
- QVERIFY(patches2.textureCoords().isEmpty());
- QCOMPARE(patches2.subdivisionDepth(), 18);
-
- QGLBezierPatches patches3;
- patches3 = patches;
-
- QCOMPARE(patches3.positions().size(), positions.size());
- QVERIFY(patches3.positions() == positions);
- QCOMPARE(patches3.textureCoords().size(), texCoords.size());
- QVERIFY(patches3.textureCoords() == texCoords);
- QCOMPARE(patches3.subdivisionDepth(), 23);
-
- patches3.setPositions(QVector3DArray());
- patches3.setTextureCoords(QVector2DArray());
- patches3.setSubdivisionDepth(18);
-
- QCOMPARE(patches.positions().size(), positions.size());
- QVERIFY(patches.positions() == positions);
- QCOMPARE(patches.textureCoords().size(), texCoords.size());
- QVERIFY(patches.textureCoords() == texCoords);
- QCOMPARE(patches.subdivisionDepth(), 23);
-
- QVERIFY(patches3.positions().isEmpty());
- QVERIFY(patches3.textureCoords().isEmpty());
- QCOMPARE(patches3.subdivisionDepth(), 18);
-
- patches = QGLBezierPatches();
- QVERIFY(patches.positions().isEmpty());
- QVERIFY(patches.textureCoords().isEmpty());
- QCOMPARE(patches.subdivisionDepth(), 4);
-}
-
-void tst_QGLBezierPatches::teapot()
-{
- // Verify that patch data is added by QGLTeapot's constructor,
- // but not what that patch data is.
- QGLTeapot teapot;
- QCOMPARE(teapot.positions().size(), 32 * 16);
- QCOMPARE(teapot.textureCoords().size(), 0);
- QCOMPARE(teapot.subdivisionDepth(), 4);
-}
-
-void tst_QGLBezierPatches::build()
-{
- // Call the build routines with different options. It isn't really
- // easy to determine if the correct triangles were generated. Leave
- // that up to visual acceptance tests.
-
- QGLBuilder builder;
-
- QGLTeapot teapot1;
- builder << teapot1;
-
- QGLTeapot teapot2;
- QVector2DArray texCoords;
- for (int index = 0; index < 32; ++index) {
- texCoords.append(0.0f, 0.5f);
- texCoords.append(0.5f, 1.0f);
- }
- teapot2.setTextureCoords(texCoords);
- builder << teapot2;
-
- delete builder.finalizedSceneNode();
-}
-
-void tst_QGLBezierPatches::transform()
-{
- QVector3DArray positions;
- for (int index = 0; index < 32; ++index)
- positions.append(index, index + 1, index + 2);
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QVector3DArray positions2 = positions.transformed(m);
-
- QVector2DArray texCoords;
- texCoords.append(0.0f, 0.5f);
- texCoords.append(0.5f, 1.0f);
- texCoords.append(0.5f, 0.0f);
- texCoords.append(1.0f, 0.5f);
-
- QGLBezierPatches patches;
- patches.setPositions(positions);
- patches.setTextureCoords(texCoords);
- patches.setSubdivisionDepth(18);
-
- QGLBezierPatches patches2(patches);
- patches2.transform(m);
- QVERIFY(patches2.positions() == positions2);
- QVERIFY(patches2.textureCoords() == texCoords);
- QCOMPARE(patches2.subdivisionDepth(), 18);
-
- QGLBezierPatches patches3 = patches.transformed(m);
- QVERIFY(patches3.positions() == positions2);
- QVERIFY(patches3.textureCoords() == texCoords);
- QCOMPARE(patches3.subdivisionDepth(), 18);
-}
-
-QTEST_APPLESS_MAIN(tst_QGLBezierPatches)
-
-#include "tst_qglbezierpatches.moc"
diff --git a/tests/auto/threed/qglbuilder/qglbuilder.pro b/tests/auto/threed/qglbuilder/qglbuilder.pro
deleted file mode 100644
index 07a07898..00000000
--- a/tests/auto/threed/qglbuilder/qglbuilder.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TARGET = tst_qglbuilder
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglbuilder.cpp
-INCLUDEPATH += ../../../../src/threed/geometry
diff --git a/tests/auto/threed/qglbuilder/tst_qglbuilder.cpp b/tests/auto/threed/qglbuilder/tst_qglbuilder.cpp
deleted file mode 100644
index dc8e4a45..00000000
--- a/tests/auto/threed/qglbuilder/tst_qglbuilder.cpp
+++ /dev/null
@@ -1,888 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtCore/qpointer.h>
-#include "qglbuilder.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include "qglsection_p.h"
-#include "qglmaterialcollection.h"
-#include "qglscenenode.h"
-#include "qglabstracteffect.h"
-#include "qtest_helpers.h"
-#include "qgeometrydata.h"
-
-class tst_QGLBuilder : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLBuilder() {}
- ~tst_QGLBuilder() {}
-
-private slots:
- void createDefault();
- void newSection();
- void newNode();
- void pushNode();
- void popNode();
- void geometryBuild();
- void addTriangles();
- void addQuads();
- void addTriangleFan();
- void addTriangulatedFace();
- void extrude();
- void finalize();
-};
-
-// Indices in a QGL::IndexArray are int on desktop, ushort on OpenGL/ES.
-// This macro works around the discrepancy to avoid confusing QCOMPARE.
-#define QCOMPARE_INDEX(x,y) QCOMPARE(int(x), int(y))
-
-class TestBuilder : public QGLBuilder
-{
-public:
- QGLSection *currentSection() { return QGLBuilder::currentSection(); }
- QList<QGLSection*> sections() { return QGLBuilder::sections(); }
-};
-
-void tst_QGLBuilder::createDefault()
-{
- // Test that a newly created builder works with no defaults
- TestBuilder builder;
- QCOMPARE(builder.currentSection(), (QGLSection*)0);
- QCOMPARE(builder.sections().size(), 0);
- QVERIFY(builder.currentNode() != 0);
- QVERIFY(builder.sceneNode() != 0);
- QVERIFY(builder.sceneNode()->geometry().isEmpty());
- QVERIFY(builder.palette() != 0);
- QGLSceneNode *root = builder.sceneNode();
- QCOMPARE(builder.finalizedSceneNode(), root);
-}
-
-void tst_QGLBuilder::newSection()
-{
- TestBuilder builder;
- builder.newSection(); // defaults to smooth
- QGLSection *s = builder.currentSection();
- QCOMPARE(s, builder.currentSection());
- QCOMPARE(builder.sections().count(), 1);
- QVERIFY(builder.sections().contains(s));
- QCOMPARE(s->smoothing(), QGL::Smooth);
- builder.newSection(QGL::Faceted);
- QGLSection *s2 = builder.currentSection();
- QCOMPARE(builder.sections().count(), 2);
- QVERIFY(builder.sections().contains(s2));
- builder << QGL::Faceted;
- QCOMPARE(builder.sections().count(), 3);
- QGLSceneNode *root = builder.sceneNode();
- QCOMPARE(builder.finalizedSceneNode(), root);
-}
-
-class TestEffect : public QGLAbstractEffect
-{
- void setActive(QGLPainter *, bool)
- {
- }
- void update(QGLPainter *, QGLPainter::Updates)
- {
- }
-};
-
-void tst_QGLBuilder::newNode()
-{
- TestBuilder builder;
- builder.newSection(); // calls new node
- QGLSceneNode *node = builder.currentNode();
-
- // newly created node works and has all defaults
- QCOMPARE(node->effect(), QGL::FlatColor); // flat color is the default
- QCOMPARE(node->userEffect(), (QGLAbstractEffect *)0);
- QCOMPARE(node->materialIndex(), -1);
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 0);
-
- // add some settings and geometry to the new node
- node->setEffect(QGL::LitDecalTexture2D);
- QGLAbstractEffect *eff = new TestEffect;
- node->setUserEffect(eff);
- node->setMaterialIndex(5);
- QGeometryData p;
- p.appendVertex(QVector3D(), QVector3D(1.0f, 2.0f, 3.0f), QVector3D(4.0f, 5.0f, 6.0f));
- builder.addTriangles(p);
-
- // now create a new node
- QGLSceneNode *node2 = builder.newNode();
-
- // the previous node got cleaned up properly, with its count updated
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 3);
-
- // new node counts off from where the previous one finished and has same defaults
- QCOMPARE(node2->start(), 3);
- QCOMPARE(node2->count(), 0);
- QCOMPARE(node2->effect(), QGL::FlatColor); // lit material is the default
- QCOMPARE(node2->userEffect(), (QGLAbstractEffect *)0);
- QCOMPARE(node2->materialIndex(), -1);
-
- builder.addTriangles(p);
- builder.newNode();
-
- // confirm that 2nd and last node in chain was also finished properly
- QCOMPARE(node2->start(), 3);
- QCOMPARE(node2->count(), 3);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::pushNode()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSceneNode *node = builder.newNode();
- node->setEffect(QGL::LitDecalTexture2D);
- QGLAbstractEffect *eff = new TestEffect;
- node->setUserEffect(eff);
- node->setMaterialIndex(5);
- QGeometryData p;
- p.appendVertex(QVector3D(), QVector3D(1.0f, 2.0f, 3.0f), QVector3D(4.0f, 5.0f, 6.0f));
- builder.addTriangles(p);
-
- QGLSceneNode *node2 = builder.pushNode();
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 3);
- QCOMPARE(builder.currentNode(), node2);
- QCOMPARE(node2->start(), 3);
- QCOMPARE(node2->count(), 0);
- QCOMPARE(node2->parent(), node);
- QCOMPARE(node2->effect(), QGL::FlatColor); // lit material is the default
- QCOMPARE(node2->userEffect(), (QGLAbstractEffect *)0);
- QCOMPARE(node2->materialIndex(), -1);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::popNode()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSceneNode *node = builder.newNode();
- node->setEffect(QGL::LitDecalTexture2D);
- QGLAbstractEffect *eff = new TestEffect;
- QMatrix4x4 mat;
- mat.rotate(45.0f, 0.0f, 1.0f, 0.0f);
- node->setLocalTransform(mat);
- node->setUserEffect(eff);
- node->setMaterialIndex(5);
- QGeometryData p;
- p.appendVertex(QVector3D(), QVector3D(1.0f, 2.0f, 3.0f), QVector3D(4.0f, 5.0f, 6.0f));
- builder.addTriangles(p);
-
- QGLSceneNode *node2 = builder.pushNode();
-
- builder.addTriangles(p);
-
- QGLSceneNode *node3 = builder.popNode();
- QCOMPARE(node2->start(), 3);
- QCOMPARE(node2->count(), 3);
-
- QCOMPARE(node3->effect(), QGL::LitDecalTexture2D);
- QCOMPARE(node3->userEffect(), eff);
- QCOMPARE(node3->materialIndex(), 5);
- QCOMPARE(node3->localTransform(), mat);
- QCOMPARE(node3->start(), 6);
- QCOMPARE(node3->count(), 0);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::geometryBuild()
-{
- // here we really just test that the right values get added
- // to the underlying QGeometryData
- TestBuilder builder;
- builder.newSection();
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
-
- QCOMPARE(sec->count(), 0); // empty to start off with
- QCOMPARE(node->count(), 0);
-
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector3D e(1.0f, 2.0f, 0.0f);
- QVector3D f(-1.0f, 2.0f, 0.0f);
- QVector3D origin;
- QVector3D norm(0.0f, 0.0f, 1.0f);
-
- QGeometryData p;
- p.appendVertex(a, b, c);
- builder.addTriangles(p);
- QCOMPARE(sec->count(), 3);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(node->count(), 3);
-
- builder.newSection();
- QGeometryData q;
- sec = builder.currentSection();
- node = builder.currentNode();
- QCOMPARE(sec->count(), 0); // empty to start off with
- QCOMPARE(node->count(), 0);
- QVector3DArray data;
- data << a << b << d << c << f << e;
- q.appendVertexArray(data);
- builder.addTriangleStrip(q);
- QCOMPARE(sec->count(), 6);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), d);
- QCOMPARE(sec->vertex(3), c);
- QCOMPARE(sec->vertex(4), f);
- QCOMPARE(sec->vertex(5), e);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(3).normalized(), norm);
- QCOMPARE(sec->normal(5).normalized(), norm);
- QCOMPARE(node->count(), 12); // TRIANGLE_STRIP will here draw 4 triangles = 12 indices
-
- // now go on and test TRIANGLE_FAN
- builder.newSection();
- sec = builder.currentSection();
- node = builder.currentNode();
- QGeometryData r;
- r.appendVertex(a);
- r.appendNormal(norm);
- r.appendVertex(b);
- r.appendNormal(norm);
- r.appendVertex(c);
- r.appendNormal(norm);
- r.appendVertex(d);
- r.appendNormal(norm);
- r.appendVertex(e);
- r.appendNormal(norm);
- builder.addTriangleFan(r);
- QCOMPARE(sec->count(), 5);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->vertex(4), e);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(4).normalized(), norm);
- QCOMPARE(node->count(), 9); // TRIANGLE_FAN will here draw 3 triangles = 9 indices
-
- QGeometryData s;
- //builder.begin(QGL::TRIANGULATED_FACE);
- builder.newSection();
- sec = builder.currentSection();
- node = builder.currentNode();
- s.appendVertex(a);
- s.appendColor(Qt::red);
- s.appendVertex(b);
- s.appendColor(QColor4ub(Qt::green));
- s.appendVertex(c);
- s.appendVertex(d);
- s.appendVertex(e);
- QArray<QColor4ub> cdata;
- cdata.append(Qt::blue, Qt::yellow, Qt::black);
- s.appendColorArray(cdata);
- builder.addTriangulatedFace(s);
- QCOMPARE(sec->count(), 5);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(4), e);
- QCOMPARE(sec->colorAt(0), QColor4ub(Qt::red));
- QCOMPARE(sec->colorAt(1), QColor4ub(Qt::green));
- QCOMPARE(sec->colorAt(2), QColor4ub(Qt::blue));
- QCOMPARE(sec->colorAt(3), QColor4ub(Qt::yellow));
- QCOMPARE(sec->colorAt(4), QColor4ub(Qt::black));
- QCOMPARE(node->count(), 12); // TRIANGLE_FAN will here draw 4 triangles = 12 indices
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::addTriangles()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector2D ta(0.0, 0.0);
- QVector2D tb(1.0, 0.0);
- QVector2D tc(1.0, 1.0);
- QVector3D norm(0.0f, 0.0f, 1.0f);
- QGeometryData p;
- p.appendVertex(a, b, c);
- p.appendNormal(norm, norm, norm);
-
- builder.addTriangles(p);
- QCOMPARE(sec->vertices().count(), 3);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->normals().count(), 3);
- QCOMPARE(sec->indices().size(), 3);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector2D td(0.0f, 1.0f);
- QGeometryData q;
- q.appendVertex(a, c, d);
- p.appendNormal(norm, norm, norm, norm);
- builder.addTriangles(q);
- QCOMPARE(sec->vertices().count(), 4);
- QCOMPARE(sec->vertex(3), d);
- QCOMPARE(sec->normals().count(), 4);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(sec->normal(3).normalized(), norm);
- QCOMPARE(sec->indices().size(), 6);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[4], 2);
- QCOMPARE_INDEX(sec->indices()[5], 3);
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 6);
-
- builder.newSection();
- sec = builder.currentSection();
- node = builder.currentNode();
- QGeometryData r;
- r.appendVertex(a, b, c);
- r.appendTexCoord(ta, tb, tc);
- builder.addTriangles(r);
- QCOMPARE(sec->vertices().count(), 3);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->normals().count(), 3);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(sec->texCoords().count(), 3);
- QCOMPARE(sec->texCoords().at(0), ta);
- QCOMPARE(sec->texCoords().at(1), tb);
- QCOMPARE(sec->texCoords().at(2), tc);
- QCOMPARE(sec->indices().size(), 3);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE(sec->fields(),
- QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal) | QGL::fieldMask(QGL::TextureCoord0));
-
- QGeometryData s;
- s.appendVertex(a, b, d);
- s.appendTexCoord(ta, tb, td);
- builder.addTriangles(s);
- QCOMPARE(sec->vertices().count(), 4);
- QCOMPARE(sec->vertex(3), d);
- QCOMPARE(sec->normals().count(), 4);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(sec->normal(3).normalized(), norm);
- QCOMPARE(sec->texCoords().count(), 4);
- QCOMPARE(sec->texCoords().at(0), QVector2D(0.0f, 0.0f));
- QCOMPARE(sec->texCoords().at(1), QVector2D(1.0f, 0.0f));
- QCOMPARE(sec->texCoords().at(2), QVector2D(1.0f, 1.0f));
- QCOMPARE(sec->texCoords().at(3), QVector2D(0.0f, 1.0f));
- QCOMPARE(sec->indices().size(), 6);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[4], 1);
- QCOMPARE_INDEX(sec->indices()[5], 3);
- QCOMPARE(sec->fields(),
- QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal) | QGL::fieldMask(QGL::TextureCoord0));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 6);
-
- // correctly handle not being a multiple of 3 - discard spare ones
- builder.newSection();
- sec = builder.currentSection();
- QGeometryData t;
- t.appendVertex(a, b, c, d);
- builder.addTriangles(t);
- QCOMPARE(sec->count(), 3);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::addQuads()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector3D norm(0.0f, 0.0f, 1.0f);
- QGeometryData p;
- p.appendVertex(a, b, c, d);
- p.appendNormal(norm, norm, norm, norm);
-
- builder.addQuads(p);
- QCOMPARE(sec->vertices().count(), 4);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->vertex(3), d);
- QCOMPARE(sec->normals().count(), 4);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(sec->normal(3).normalized(), norm);
- QCOMPARE(sec->indices().size(), 6);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[4], 2);
- QCOMPARE_INDEX(sec->indices()[5], 3);
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 6);
-
- builder.newSection();
- sec = builder.currentSection();
- node = builder.currentNode();
- QVector2D ta(0.0f, 0.0f);
- QVector2D tb(1.0f, 0.0f);
- QVector2D tc(1.0f, 1.0f);
- QVector2D td(0.0f, 1.0f);
- QGeometryData q;
- q.appendVertex(a, b, c, d);
- q.appendTexCoord(ta, tb, tc, td);
- builder.addQuads(q);
-
- QCOMPARE(sec->vertices().count(), 4);
- QCOMPARE(sec->vertex(0), a);
- QCOMPARE(sec->vertex(1), b);
- QCOMPARE(sec->vertex(2), c);
- QCOMPARE(sec->vertex(3), d);
- QCOMPARE(sec->normals().count(), 4);
- QCOMPARE(sec->normal(0).normalized(), norm);
- QCOMPARE(sec->normal(1).normalized(), norm);
- QCOMPARE(sec->normal(2).normalized(), norm);
- QCOMPARE(sec->normal(3).normalized(), norm);
- QCOMPARE(sec->texCoords().count(), 4);
- QCOMPARE(sec->texCoords().at(0), ta);
- QCOMPARE(sec->texCoords().at(1), tb);
- QCOMPARE(sec->texCoords().at(2), tc);
- QCOMPARE(sec->texCoords().at(3), td);
- QCOMPARE(sec->indices().size(), 6);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[4], 2);
- QCOMPARE_INDEX(sec->indices()[5], 3);
- QCOMPARE(sec->fields(),
- QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal) | QGL::fieldMask(QGL::TextureCoord0));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 6);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::addTriangleFan()
-{
- TestBuilder builder;
- builder.newSection(QGL::Faceted);
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- qreal one_on_root2 = 1.0f / sqrt(2.0f);
- QVector3D n1(0.0f, -one_on_root2, one_on_root2);
- QVector3D n2(one_on_root2, 0.0f, one_on_root2);
- QVector3D n3(0.0f, one_on_root2, one_on_root2);
- QVector3D center(0.0f, 0.0f, 1.0f);
- QVector2DArray edges;
-
- // if edges has length < 2, exit without doing anything
- QGeometryData p;
- p.appendVertex(center);
- builder.addTriangleFan(p);
- QCOMPARE(sec->vertices().count(), 0);
- QCOMPARE(sec->normals().count(), 0);
- QCOMPARE(sec->indices().size(), 0);
-
- p.appendVertex(a, b, c, d);
-
- builder.addTriangleFan(p);
- sec->normalizeNormals();
- QCOMPARE(sec->vertices().count(), 9);
- QCOMPARE(sec->vertex(0), center);
- QCOMPARE(sec->vertex(1), a);
- QCOMPARE(sec->vertex(2), b);
- QCOMPARE(sec->vertex(3), center);
- QCOMPARE(sec->vertex(4), b);
- QCOMPARE(sec->vertex(5), c);
- QCOMPARE(sec->vertex(6), center);
- QCOMPARE(sec->vertex(7), c);
- QCOMPARE(sec->vertex(8), d);
- QCOMPARE(sec->normals().count(), 9);
- QCOMPARE(sec->normal(0), n1);
- QCOMPARE(sec->normal(1), n1);
- QCOMPARE(sec->normal(2), n1);
- QCOMPARE(sec->normal(3), n2);
- QCOMPARE(sec->normal(4), n2);
- QCOMPARE(sec->normal(5), n2);
- QCOMPARE(sec->normal(6), n3);
- QCOMPARE(sec->normal(7), n3);
- QCOMPARE(sec->normal(8), n3);
- QCOMPARE(sec->indices().size(), 9);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE_INDEX(sec->indices()[3], 3);
- QCOMPARE_INDEX(sec->indices()[4], 4);
- QCOMPARE_INDEX(sec->indices()[5], 5);
- QCOMPARE_INDEX(sec->indices()[6], 6);
- QCOMPARE_INDEX(sec->indices()[7], 7);
- QCOMPARE_INDEX(sec->indices()[8], 8);
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 9);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::addTriangulatedFace()
-{
- TestBuilder builder;
- builder.newSection(QGL::Faceted);
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector3D n(0.0f, 0.0f, 1.0f);
- QVector3D center(0.0f, 0.0f, 0.0f);
- QVector2DArray edges;
-
- // if edges has length < 2, exit without doing anything
- QGeometryData p;
- builder.addTriangleFan(p);
- QCOMPARE(sec->vertices().count(), 0);
- QCOMPARE(sec->normals().count(), 0);
- QCOMPARE(sec->indices().size(), 0);
-
- p.appendVertex(center);
- p.appendVertex(a, b, c, d);
-
- builder.addTriangulatedFace(p);
- sec->normalizeNormals();
- QCOMPARE(sec->vertices().count(), 5);
- QCOMPARE(sec->vertex(0), center);
- QCOMPARE(sec->vertex(1), a);
- QCOMPARE(sec->vertex(2), b);
- QCOMPARE(sec->vertex(3), c);
- QCOMPARE(sec->vertex(4), d);
- QCOMPARE(sec->normals().count(), 5);
- QCOMPARE(sec->normal(0), n);
- QCOMPARE(sec->normal(1), n);
- QCOMPARE(sec->normal(2), n);
- QCOMPARE(sec->normal(3), n);
- QCOMPARE(sec->normal(4), n);
- QCOMPARE(sec->indices().size(), 12);
- QCOMPARE_INDEX(sec->indices()[0], 0);
- QCOMPARE_INDEX(sec->indices()[1], 1);
- QCOMPARE_INDEX(sec->indices()[2], 2);
- QCOMPARE_INDEX(sec->indices()[3], 0);
- QCOMPARE_INDEX(sec->indices()[4], 2);
- QCOMPARE_INDEX(sec->indices()[5], 3);
- QCOMPARE_INDEX(sec->indices()[6], 0);
- QCOMPARE_INDEX(sec->indices()[7], 3);
- QCOMPARE_INDEX(sec->indices()[8], 4);
- QCOMPARE_INDEX(sec->indices()[9], 0);
- QCOMPARE_INDEX(sec->indices()[10], 4);
- QCOMPARE_INDEX(sec->indices()[11], 1);
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 12);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::extrude()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSection *sec = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector3D n(0.0f, 0.0f, 1.0f);
- QVector3DArray edges;
-
- // if edges has length < 2, exit without doing anything
- QGeometryData p;
- QGeometryData q;
- builder.addQuadsInterleaved(p, q);
- QCOMPARE(sec->vertices().count(), 0);
- QCOMPARE(sec->normals().count(), 0);
- QCOMPARE(sec->indices().size(), 0);
-
- p.appendVertex(a, b, c, d);
- edges = p.vertices();
- p.appendVertex(a);
- q = p.translated(-n);
-
- qreal one_on_root2 = 1.0f / sqrt(2.0f);
- QVector3D n1(-one_on_root2, -one_on_root2, 0.0f);
- QVector3D n2(one_on_root2, -one_on_root2, 0.0f);
- QVector3D n3(one_on_root2, one_on_root2, 0.0f);
- QVector3D n4(-one_on_root2, one_on_root2, 0.0f);
-
- builder.addQuadsInterleaved(p, q);
- //sec->normalizeNormals();
-
- QCOMPARE(sec->count(), 8);
- QVector3DArray vrts = sec->vertices();
- QVector3DArray nrms = sec->normals();
- QGL::IndexArray inxs = sec->indices();
-
- QCOMPARE(vrts.count(), 8);
- QCOMPARE(vrts.at(0), edges.at(0) - n);
- QCOMPARE(vrts.at(1), edges.at(1) - n);
- QCOMPARE(vrts.at(2), edges.at(1));
- QCOMPARE(vrts.at(3), edges.at(0));
- QCOMPARE(vrts.at(4), edges.at(2) - n);
- QCOMPARE(vrts.at(5), edges.at(2));
- QCOMPARE(vrts.at(6), edges.at(3) - n);
- QCOMPARE(vrts.at(7), edges.at(3));
-
- QCOMPARE(nrms.count(), 8);
- QCOMPARE(nrms.at(0).normalized(), n1);
- QCOMPARE(nrms.at(1).normalized(), n2);
- QCOMPARE(nrms.at(2).normalized(), n2);
- QCOMPARE(nrms.at(3).normalized(), n1);
- QCOMPARE(nrms.at(4).normalized(), n3);
- QCOMPARE(nrms.at(5).normalized(), n3);
- QCOMPARE(nrms.at(6).normalized(), n4);
- QCOMPARE(nrms.at(7).normalized(), n4);
-
- static int checkIx[] = {
- 0, 1, 2, 0, 2, 3,
- 1, 4, 5, 1, 5, 2,
- 4, 6, 7, 4, 7, 5,
- 6, 0, 3, 6, 3, 7
- };
- QCOMPARE(sec->indices().size(), 24);
-
- QCOMPARE_INDEX(inxs[0], checkIx[0]);
- QCOMPARE_INDEX(inxs[1], checkIx[1]);
- QCOMPARE_INDEX(inxs[2], checkIx[2]);
- QCOMPARE_INDEX(inxs[3], checkIx[3]);
- QCOMPARE_INDEX(inxs[4], checkIx[4]);
- QCOMPARE_INDEX(inxs[5], checkIx[5]);
- QCOMPARE_INDEX(inxs[6], checkIx[6]);
- QCOMPARE_INDEX(inxs[7], checkIx[7]);
- QCOMPARE_INDEX(inxs[8], checkIx[8]);
- QCOMPARE_INDEX(inxs[9], checkIx[9]);
- QCOMPARE_INDEX(inxs[10], checkIx[10]);
- QCOMPARE_INDEX(inxs[11], checkIx[11]);
- QCOMPARE_INDEX(inxs[12], checkIx[12]);
- QCOMPARE_INDEX(inxs[13], checkIx[13]);
- QCOMPARE_INDEX(inxs[14], checkIx[14]);
- QCOMPARE_INDEX(inxs[15], checkIx[15]);
- QCOMPARE_INDEX(inxs[16], checkIx[16]);
- QCOMPARE_INDEX(inxs[17], checkIx[17]);
- QCOMPARE_INDEX(inxs[18], checkIx[18]);
- QCOMPARE_INDEX(inxs[19], checkIx[19]);
- QCOMPARE_INDEX(inxs[20], checkIx[20]);
- QCOMPARE_INDEX(inxs[21], checkIx[21]);
- QCOMPARE_INDEX(inxs[22], checkIx[22]);
- QCOMPARE_INDEX(inxs[23], checkIx[23]);
-
- QCOMPARE(sec->fields(), QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::Normal));
-
- QCOMPARE(node->start(), 0);
- QCOMPARE(node->count(), 24);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLBuilder::finalize()
-{
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QVector3D d(-1.0f, 1.0f, 0.0f);
- QVector3D center(0.0f, 0.0f, 0.0f);
- QVector3D n(0.0f, 0.0f, 1.0f);
-
- // backwards wound triangle - on back face
- QVector3D e(1.0f, -1.0f, 1.0f);
- QVector3D f(-1.0f, -1.0f, 1.0f);
- QVector3D g(-1.0f, 1.0f, 1.0f);
- // normal points back
- QVector3D n10(0.0f, 0.0f, -1.0f);
-
- QGeometryData p;
- p.appendVertex(center);
- p.appendVertex(a, b, c, d);
-
- qreal one_on_root2 = 1.0f / sqrt(2.0f);
- QVector3D n0(0.0f, 0.0f, 1.0f);
- QVector3D n1(-one_on_root2, -one_on_root2, 0.0f);
- QVector3D n2(one_on_root2, -one_on_root2, 0.0f);
- QVector3D n3(one_on_root2, one_on_root2, 0.0f);
- QVector3D n4(-one_on_root2, one_on_root2, 0.0f);
-
- TestBuilder builder;
- builder.newSection();
- QGLSceneNode *node = builder.currentNode();
-
- builder.addTriangulatedFace(p);
-
- builder.newSection();
- QGLSceneNode *node2 = builder.currentNode();
-
- QGeometryData s;
- s.appendVertex(a, b, c, d);
- s.appendVertex(a);
- builder.addQuadsInterleaved(s, s.translated(-n));
-
- QPointer<QGLSceneNode> nodeEmpty0 = builder.newNode();
-
- builder.newSection();
- QGLSceneNode *node3 = builder.currentNode();
-
- QGeometryData q;
- QVector2D ta(0.0f, 0.0f);
- QVector2D tb(1.0f, 0.0f);
- QVector2D tc(1.0f, 1.0f);
- q.appendVertex(e, f, g);
- q.appendTexCoord(ta, tb, tc);
- // reverse winding, backwards normal == n10
- builder.addTriangles(q);
-
- QPointer<QGLSceneNode> nodeEmpty1 = builder.pushNode();
-
- builder.finalizedSceneNode();
-
- QCOMPARE(nodeEmpty0.data(), (QGLSceneNode*)0);
- QCOMPARE(nodeEmpty1.data(), (QGLSceneNode*)0);
-
- QCOMPARE(builder.sections().count(), 0);
-
- QGeometryData geom = node->geometry();
- QGL::IndexArray ids = geom.indices();
-
- QCOMPARE(geom.count(QGL::Position), 13);
- QCOMPARE(ids.size(), 36);
-
- // triangulated face
- int tf = ids[node->start()]; // beginning of triangulated face
- QCOMPARE(node->count(), 12);
- QCOMPARE(geom.vertexAt(tf), center);
- QCOMPARE(geom.vertexAt(tf + 2), b);
- QCOMPARE(geom.normalAt(tf), n0);
- QCOMPARE(geom.normalAt(tf + 2), n0);
-
- geom = node2->geometry();
- ids = geom.indices();
-
- int ext = ids[node2->start()]; // beginning of extrude
- int last = ids[node2->start() + (node2->count() - 1)];
- QCOMPARE(node2->count(), 24);
- QCOMPARE(geom.vertexAt(ext), a - n);
- QCOMPARE(geom.normalAt(ext), n1);
- QCOMPARE(geom.vertexAt(last), d);
- QCOMPARE(geom.normalAt(last), n4);
-
- // the first two nodes and the builder itself all reference the same
- // geometry object, since they all have the same types: just vertices
- // and normals. the last node has geometry with textures, so its in
- // a different geometry object.
- QVERIFY(node->geometry() == geom);
- QVERIFY(node2->geometry() == geom);
- QVERIFY(!(node3->geometry() == geom));
-
- geom = node3->geometry();
- QGL::IndexArray ids2 = geom.indices();
-
- int tri = ids2[node->start()];
- QCOMPARE(geom.vertexAt(tri), e);
- QCOMPARE(geom.normalAt(tri), n10);
- QCOMPARE(geom.texCoordAt(tri), ta);
-}
-
-QTEST_APPLESS_MAIN(tst_QGLBuilder)
-
-#include "tst_qglbuilder.moc"
diff --git a/tests/auto/threed/qglcamera/qglcamera.pro b/tests/auto/threed/qglcamera/qglcamera.pro
deleted file mode 100644
index 89ccf5b0..00000000
--- a/tests/auto/threed/qglcamera/qglcamera.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = tst_qglcamera
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../threed/viewing
-VPATH += ../../../../threed/viewing
-
-SOURCES += \
- tst_qglcamera.cpp
diff --git a/tests/auto/threed/qglcamera/tst_qglcamera.cpp b/tests/auto/threed/qglcamera/tst_qglcamera.cpp
deleted file mode 100644
index 2240a1b8..00000000
--- a/tests/auto/threed/qglcamera/tst_qglcamera.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglcamera.h"
-
-class tst_QGLCamera : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLCamera() {}
- ~tst_QGLCamera() {}
-
-private slots:
- void create();
- void modify();
- void minViewSize();
- void translation_data();
- void translation();
- void rotate_data();
- void rotate();
-};
-
-void tst_QGLCamera::create()
-{
- // Test that a newly created object has the correct defaults.
- QGLCamera camera;
- QVERIFY(camera.projectionType() == QGLCamera::Perspective);
- QCOMPARE(camera.fieldOfView(), (qreal)0.0f);
- QCOMPARE(camera.nearPlane(), (qreal)5.0f);
- QCOMPARE(camera.farPlane(), (qreal)1000.0f);
- QCOMPARE(camera.viewSize(), QSizeF(2.0f, 2.0f));
- QCOMPARE(camera.minViewSize(), QSizeF(0.0001f, 0.0001f));
- QCOMPARE(camera.screenRotation(), 0);
- QVERIFY(camera.eye() == QVector3D(0, 0, 10));
- QVERIFY(camera.upVector() == QVector3D(0, 1, 0));
- QVERIFY(camera.center() == QVector3D(0, 0, 0));
- QCOMPARE(camera.eyeSeparation(), (qreal)0.0f);
- QVERIFY(camera.motionAdjustment() == QVector3D(0, 0, 1));
- QVERIFY(camera.adjustForAspectRatio());
-}
-
-void tst_QGLCamera::modify()
-{
- // Test modifying each field individually.
- QGLCamera camera;
- QSignalSpy spy1(&camera, SIGNAL(projectionChanged()));
- QSignalSpy spy2(&camera, SIGNAL(viewChanged()));
- camera.setProjectionType(QGLCamera::Orthographic);
- QVERIFY(camera.projectionType() == QGLCamera::Orthographic);
- QCOMPARE(spy1.size(), 1);
- camera.setFieldOfView(60.0f);
- QCOMPARE(camera.fieldOfView(), (qreal)60.0f);
- QCOMPARE(spy1.size(), 2);
- camera.setNearPlane(-3.0f);
- QCOMPARE(camera.nearPlane(), (qreal)-3.0f);
- QCOMPARE(spy1.size(), 3);
- camera.setFarPlane(3000.0f);
- QCOMPARE(camera.farPlane(), (qreal)3000.0f);
- QCOMPARE(spy1.size(), 4);
- camera.setViewSize(QSizeF(45.0f, 25.5f));
- QCOMPARE(camera.viewSize(), QSizeF(45.0f, 25.5f));
- QCOMPARE(spy1.size(), 5);
- camera.setMinViewSize(QSizeF(0.05f, 0.025f));
- QCOMPARE(camera.minViewSize(), QSizeF(0.05f, 0.025f));
- QCOMPARE(spy1.size(), 6);
- camera.setScreenRotation(270);
- QCOMPARE(camera.screenRotation(), 270);
- QCOMPARE(spy1.size(), 7);
- camera.setEye(QVector3D(1.0f, 2.0f, 3.0f));
- QVERIFY(camera.eye() == QVector3D(1.0f, 2.0f, 3.0f));
- QCOMPARE(spy2.size(), 1);
- camera.setUpVector(QVector3D(4.0f, 5.0f, 6.0f));
- QVERIFY(camera.upVector() == QVector3D(4.0f, 5.0f, 6.0f));
- QCOMPARE(spy2.size(), 2);
- camera.setCenter(QVector3D(7.0f, 8.0f, 9.0f));
- QVERIFY(camera.center() == QVector3D(7.0f, 8.0f, 9.0f));
- QCOMPARE(spy2.size(), 3);
- camera.setEyeSeparation(3.0f);
- QCOMPARE(camera.eyeSeparation(), (qreal)3.0f);
- QCOMPARE(spy2.size(), 4);
- camera.setMotionAdjustment(QVector3D(10.0f, 11.0f, 12.0f));
- QVERIFY(camera.motionAdjustment() == QVector3D(10.0f, 11.0f, 12.0f));
- QCOMPARE(spy2.size(), 5);
- camera.setAdjustForAspectRatio(false);
- QVERIFY(!camera.adjustForAspectRatio());
- QCOMPARE(spy2.size(), 6);
-
- // Test that we don't get any side effects between properties.
- QVERIFY(camera.projectionType() == QGLCamera::Orthographic);
- QCOMPARE(camera.fieldOfView(), (qreal)60.0f);
- QCOMPARE(camera.nearPlane(), (qreal)-3.0f);
- QCOMPARE(camera.farPlane(), (qreal)3000.0f);
- QCOMPARE(camera.viewSize(), QSizeF(45.0f, 25.5f));
- QCOMPARE(camera.minViewSize(), QSizeF(0.05f, 0.025f));
- QCOMPARE(camera.screenRotation(), 270);
- QVERIFY(camera.eye() == QVector3D(1.0f, 2.0f, 3.0f));
- QVERIFY(camera.upVector() == QVector3D(4.0f, 5.0f, 6.0f));
- QVERIFY(camera.center() == QVector3D(7.0f, 8.0f, 9.0f));
- QCOMPARE(camera.eyeSeparation(), (qreal)3.0f);
- QVERIFY(camera.motionAdjustment() == QVector3D(10.0f, 11.0f, 12.0f));
- QVERIFY(!camera.adjustForAspectRatio());
-
- // Test that changing to the same values does not emit any signals.
- camera.setProjectionType(QGLCamera::Orthographic);
- camera.setFieldOfView(60.0f);
- camera.setNearPlane(-3.0f);
- camera.setFarPlane(3000.0f);
- camera.setViewSize(QSizeF(45.0f, 25.5f));
- camera.setMinViewSize(QSizeF(0.05f, 0.025f));
- camera.setScreenRotation(270);
- camera.setEye(QVector3D(1.0f, 2.0f, 3.0f));
- camera.setUpVector(QVector3D(4.0f, 5.0f, 6.0f));
- camera.setCenter(QVector3D(7.0f, 8.0f, 9.0f));
- camera.setEyeSeparation(3.0f);
- camera.setMotionAdjustment(QVector3D(10.0f, 11.0f, 12.0f));
- camera.setAdjustForAspectRatio(false);
- QCOMPARE(spy1.size(), 7);
- QCOMPARE(spy2.size(), 6);
-}
-
-// Check that the minimum view size works correctly, including when
-// the view size goes negative (e.g. for flipped y co-ordinates).
-void tst_QGLCamera::minViewSize()
-{
- QGLCamera camera;
- camera.setMinViewSize(QSizeF(0.05f, 0.05f));
- QCOMPARE(camera.minViewSize(), QSizeF(0.05f, 0.05f));
- camera.setViewSize(QSizeF(-20.0f, -30.0f));
- QCOMPARE(camera.viewSize(), QSizeF(-20.0f, -30.0f));
- camera.setViewSize(QSizeF(0.0f, 1.0f));
- QCOMPARE(camera.viewSize(), QSizeF(0.05f, 1.0f));
- camera.setViewSize(QSizeF(-0.01f, 1.0f));
- QCOMPARE(camera.viewSize(), QSizeF(-0.05f, 1.0f));
- camera.setViewSize(QSizeF(-1.0f, 0.0f));
- QCOMPARE(camera.viewSize(), QSizeF(-1.0f, 0.05f));
- camera.setViewSize(QSizeF(-1.0f, -0.01f));
- QCOMPARE(camera.viewSize(), QSizeF(-1.0f, -0.05f));
-}
-
-static bool fuzzyCompare(const QVector3D &v1, const QVector3D &v2)
-{
- if (qAbs(v1.x() - v2.x()) <= 0.00001 &&
- qAbs(v1.y() - v2.y()) <= 0.00001 &&
- qAbs(v1.z() - v2.z()) <= 0.00001) {
- return true;
- }
- qWarning() << "actual:" << v1 << "expected:" << v2;
- return false;
-}
-
-static bool fuzzyCompare(const QQuaternion &q1, const QQuaternion &q2)
-{
- if (qAbs(q1.x() - q2.x()) <= 0.00001 &&
- qAbs(q1.y() - q2.y()) <= 0.00001 &&
- qAbs(q1.z() - q2.z()) <= 0.00001 &&
- qAbs(q1.scalar() - q2.scalar()) <= 0.00001) {
- return true;
- }
- qWarning() << "actual:" << q1 << "expected:" << q2;
- return false;
-}
-
-void tst_QGLCamera::translation_data()
-{
- QTest::addColumn<QVector3D>("eye");
- QTest::addColumn<QVector3D>("upVector");
- QTest::addColumn<QVector3D>("center");
-
- QTest::newRow("default")
- << QVector3D(0, 0, 10) << QVector3D(0, 1, 0) << QVector3D(0, 0, 0);
- QTest::newRow("random")
- << QVector3D(2, -3, 5) << QVector3D(1, -1, 1) << QVector3D(-1, 6, -2);
-}
-
-void tst_QGLCamera::translation()
-{
- QFETCH(QVector3D, eye);
- QFETCH(QVector3D, upVector);
- QFETCH(QVector3D, center);
-
- QGLCamera camera;
- camera.setEye(eye);
- camera.setUpVector(upVector);
- camera.setCenter(center);
-
- QVector3D viewVector = center - eye;
- QVector3D sideVector = QVector3D::crossProduct(viewVector, upVector);
-
- QVector3D nup = upVector.normalized();
- QVector3D nview = viewVector.normalized();
- QVector3D nside = sideVector.normalized();
-
- QVERIFY(fuzzyCompare(camera.translation(0, 0, 0), QVector3D(0, 0, 0)));
-
- QVERIFY(fuzzyCompare(camera.translation(2.5f, 0, 0), 2.5f * nside));
- QVERIFY(fuzzyCompare(camera.translation(0, -1.5f, 0), -1.5f * nup));
- QVERIFY(fuzzyCompare(camera.translation(0, 0, 2.0f), 2.0f * nview));
-
- QVector3D t = camera.translation(2.5f, -1.5f, 2.0f);
- QVERIFY(fuzzyCompare(t, 2.5f * nside - 1.5f * nup + 2.0f * nview));
-
- camera.translateEye(2.5f, -1.5f, 2.0f);
- QVERIFY(fuzzyCompare(camera.eye(), eye + t));
- QVERIFY(fuzzyCompare(camera.center(), center));
- QVERIFY(fuzzyCompare(camera.upVector(), upVector));
-
- camera.setEye(eye);
-
- camera.translateCenter(2.5f, -1.5f, 2.0f);
- QVERIFY(fuzzyCompare(camera.eye(), eye));
- QVERIFY(fuzzyCompare(camera.center(), center + t));
- QVERIFY(fuzzyCompare(camera.upVector(), upVector));
-}
-
-void tst_QGLCamera::rotate_data()
-{
- translation_data();
-}
-
-void tst_QGLCamera::rotate()
-{
- QFETCH(QVector3D, eye);
- QFETCH(QVector3D, upVector);
- QFETCH(QVector3D, center);
-
- QGLCamera camera;
- camera.setEye(eye);
- camera.setUpVector(upVector);
- camera.setCenter(center);
-
- QVector3D viewVector = center - eye;
- QVector3D sideVector = QVector3D::crossProduct(viewVector, upVector);
-
- QQuaternion tilt = camera.tilt(-30.0f);
- QQuaternion pan = camera.pan(125.0f);
- QQuaternion roll = camera.roll(45.0f);
-
- QVERIFY(fuzzyCompare(tilt, QQuaternion::fromAxisAndAngle(sideVector, -30.0f)));
- QVERIFY(fuzzyCompare(pan, QQuaternion::fromAxisAndAngle(upVector, 125.0f)));
- QVERIFY(fuzzyCompare(roll, QQuaternion::fromAxisAndAngle(viewVector, 45.0f)));
-
- QQuaternion combined = tilt * pan * roll;
- camera.rotateEye(combined);
-
- QVERIFY(fuzzyCompare(camera.eye(), eye));
- QVERIFY(fuzzyCompare(camera.upVector(), combined.rotatedVector(upVector)));
- QVERIFY(fuzzyCompare(camera.center(), eye + combined.rotatedVector(viewVector)));
-
- camera.setEye(eye);
- camera.setUpVector(upVector);
- camera.setCenter(center);
-
- camera.rotateCenter(combined);
- QVERIFY(fuzzyCompare(camera.eye(), center - combined.rotatedVector(viewVector)));
- QVERIFY(fuzzyCompare(camera.upVector(), combined.rotatedVector(upVector)));
- QVERIFY(fuzzyCompare(camera.center(), center));
-
-#define TestTiltPanRoll(order, combine) \
- do { \
- combined = combine; \
- camera.setEye(eye); \
- camera.setUpVector(upVector); \
- camera.setCenter(center); \
- camera.tiltPanRollEye(-30.0f, 125.0f, 45.0f, QGLCamera::order); \
- QVERIFY(fuzzyCompare(camera.eye(), eye)); \
- QVERIFY(fuzzyCompare(camera.upVector(), combined.rotatedVector(upVector))); \
- QVERIFY(fuzzyCompare(camera.center(), eye + combined.rotatedVector(viewVector))); \
- camera.setEye(eye); \
- camera.setUpVector(upVector); \
- camera.setCenter(center); \
- camera.tiltPanRollCenter(-30.0f, 125.0f, 45.0f, QGLCamera::order); \
- QVERIFY(fuzzyCompare(camera.eye(), center - combined.rotatedVector(viewVector))); \
- QVERIFY(fuzzyCompare(camera.upVector(), combined.rotatedVector(upVector))); \
- QVERIFY(fuzzyCompare(camera.center(), center)); \
- } while (0)
-
- // Quaternions are multiplied in the reverse order of applying them.
- TestTiltPanRoll(TiltPanRoll, roll * pan * tilt);
- TestTiltPanRoll(TiltRollPan, pan * roll * tilt);
- TestTiltPanRoll(PanTiltRoll, roll * tilt * pan);
- TestTiltPanRoll(PanRollTilt, tilt * roll * pan);
- TestTiltPanRoll(RollTiltPan, pan * tilt * roll);
- TestTiltPanRoll(RollPanTilt, tilt * pan * roll);
-}
-
-QTEST_APPLESS_MAIN(tst_QGLCamera)
-
-#include "tst_qglcamera.moc"
diff --git a/tests/auto/threed/qglcameraanimation/qglcameraanimation.pro b/tests/auto/threed/qglcameraanimation/qglcameraanimation.pro
deleted file mode 100644
index 9e21a912..00000000
--- a/tests/auto/threed/qglcameraanimation/qglcameraanimation.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglcameraanimation
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../threed/viewing
-VPATH += ../../../../threed/viewing
-
-SOURCES += tst_qglcameraanimation.cpp
diff --git a/tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp b/tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp
deleted file mode 100644
index d0c0060d..00000000
--- a/tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglcameraanimation.h"
-#include "qglcamera.h"
-
-class tst_QGLCameraAnimation : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLCameraAnimation() {}
- ~tst_QGLCameraAnimation() {}
-
-private slots:
- void properties();
- void animationStartEnd();
-};
-
-void tst_QGLCameraAnimation::properties()
-{
- // Check the default property values.
- QGLCameraAnimation anim;
- QVERIFY(anim.camera() == 0);
- QVERIFY(anim.startEye() == QVector3D(0.0f, 0.0f, 10.0f));
- QVERIFY(anim.startUpVector() == QVector3D(0.0f, 1.0f, 0.0f));
- QVERIFY(anim.startCenter() == QVector3D(0.0f, 0.0f, 0.0f));
- QVERIFY(anim.endEye() == QVector3D(0.0f, 0.0f, 10.0f));
- QVERIFY(anim.endUpVector() == QVector3D(0.0f, 1.0f, 0.0f));
- QVERIFY(anim.endCenter() == QVector3D(0.0f, 0.0f, 0.0f));
- QCOMPARE(anim.duration(), 250);
- QVERIFY(anim.easingCurve() == QEasingCurve());
-
- // Change the properties.
- QGLCamera camera;
- anim.setCamera(&camera);
- anim.setStartEye(QVector3D(1, -2, 3));
- anim.setStartUpVector(QVector3D(-4, 5, -6));
- anim.setStartCenter(QVector3D(7, -8, 9));
- anim.setEndEye(QVector3D(-1, 2, -3));
- anim.setEndUpVector(QVector3D(4, -5, 6));
- anim.setEndCenter(QVector3D(-7, 8, -9));
- anim.setDuration(500);
- anim.setEasingCurve(QEasingCurve::OutQuad);
-
- // Check that the properties have their new values.
- QVERIFY(anim.camera() == &camera);
- QVERIFY(anim.startEye() == QVector3D(1, -2, 3));
- QVERIFY(anim.startUpVector() == QVector3D(-4, 5, -6));
- QVERIFY(anim.startCenter() == QVector3D(7, -8, 9));
- QVERIFY(anim.endEye() == QVector3D(-1, 2, -3));
- QVERIFY(anim.endUpVector() == QVector3D(4, -5, 6));
- QVERIFY(anim.endCenter() == QVector3D(-7, 8, -9));
- QCOMPARE(anim.duration(), 500);
- QVERIFY(anim.easingCurve() == QEasingCurve(QEasingCurve::OutQuad));
-}
-
-void tst_QGLCameraAnimation::animationStartEnd()
-{
- QGLCameraAnimation anim;
- QGLCamera camera;
- QGLCamera camera2;
-
- anim.setCamera(&camera);
- anim.setStartEye(QVector3D(1, -2, 3));
- anim.setStartUpVector(QVector3D(-4, 5, -6));
- anim.setStartCenter(QVector3D(7, -8, 9));
- anim.setEndEye(QVector3D(-1, 2, -3));
- anim.setEndUpVector(QVector3D(4, -5, 6));
- anim.setEndCenter(QVector3D(-7, 8, -9));
- anim.setDuration(1);
-
- // Verify the start state.
- anim.start();
- QVERIFY(camera.eye() == anim.startEye());
- QVERIFY(camera.upVector() == anim.startUpVector());
- QVERIFY(camera.center() == anim.startCenter());
-
- // Wait for the animation to end
- QTRY_COMPARE(anim.state(), QAbstractAnimation::Stopped);
- QVERIFY(camera.eye() == anim.endEye());
- QVERIFY(camera.upVector() == anim.endUpVector());
- QVERIFY(camera.center() == anim.endCenter());
-
- // Zero duration animation instantly transitions to the end state.
- anim.setCamera(&camera2);
- anim.setDuration(0);
- anim.start();
- QVERIFY(camera2.eye() == anim.endEye());
- QVERIFY(camera2.upVector() == anim.endUpVector());
- QVERIFY(camera2.center() == anim.endCenter());
-}
-
-QTEST_MAIN(tst_QGLCameraAnimation)
-
-#include "tst_qglcameraanimation.moc"
diff --git a/tests/auto/threed/qglcolladafxeffectfactory/collada_cube.xml b/tests/auto/threed/qglcolladafxeffectfactory/collada_cube.xml
deleted file mode 100644
index 85d30d58..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/collada_cube.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<COLLADA xmlns="http://www.collada.org/2008/03/COLLADASchema" version="1.5.0">
- <asset>
- <created>2005-11-14T02:16:38Z</created>
- <modified>2005-11-15T11:36:38Z</modified>
- <revision>1.0</revision>
- </asset>
- <library_effects>
- <effect id="whitePhong">
- <profile_COMMON>
- <technique sid="phong1">
- <phong>
- <emission>
- <color>0 0 0.3 1.0</color>
- </emission>
- <ambient>
- <color>1.0 0 0 1.0</color>
- </ambient>
- <diffuse>
- <color>0 1 0 1.0</color>
- </diffuse>
- <specular>
- <color>1.0 1.0 1.0 1.0</color>
- </specular>
- <shininess>
- <float>20.0</float>
- </shininess>
- <reflective>
- <color>1.0 1.0 1.0 1.0</color>
- </reflective>
- <reflectivity>
- <float>0.5</float>
- </reflectivity>
- <transparent>
- <color>1.0 1.0 1.0 1.0</color>
- </transparent>
- <transparency>
- <float>1.0</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- </library_effects>
- <library_materials>
- <material id="whiteMaterial">
- <instance_effect url="#whitePhong"/>
- </material>
- </library_materials>
- <library_geometries>
- <geometry id="box" name="box">
- <mesh>
- <source id="box-Pos">
- <float_array id="box-Pos-array" count="24">
- -0.5 0.5 0.5
- 0.5 0.5 0.5
- -0.5 -0.5 0.5
- 0.5 -0.5 0.5
- -0.5 0.5 -0.5
- 0.5 0.5 -0.5
- -0.5 -0.5 -0.5
- 0.5 -0.5 -0.5
- </float_array>
- <technique_common>
- <accessor source="#box-Pos-array" count="8" stride="3">
- <param name="X" type="float" />
- <param name="Y" type="float" />
- <param name="Z" type="float" />
- </accessor>
- </technique_common>
- </source>
- <source id="box-0-Normal">
- <float_array id="box-0-Normal-array" count="18">
- 1.0 0.0 0.0
- -1.0 0.0 0.0
- 0.0 1.0 0.0
- 0.0 -1.0 0.0
- 0.0 0.0 1.0
- 0.0 0.0 -1.0
- </float_array>
- <technique_common>
- <accessor source="#box-0-Normal-array" count="6" stride="3">
- <param name="X" type="float"/>
- <param name="Y" type="float"/>
- <param name="Z" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <vertices id="box-Vtx">
- <input semantic="POSITION" source="#box-Pos"/>
- </vertices>
- <polygons count="6" material="WHITE">
- <input semantic="VERTEX" source="#box-Vtx" offset="0"/>
- <input semantic="NORMAL" source="#box-0-Normal" offset="1"/>
- <p>0 4 2 4 3 4 1 4</p>
- <p>0 2 1 2 5 2 4 2</p>
- <p>6 3 7 3 3 3 2 3</p>
- <p>0 1 4 1 6 1 2 1</p>
- <p>3 0 7 0 5 0 1 0</p>
- <p>5 5 7 5 6 5 4 5</p>
- </polygons>
- </mesh>
- </geometry>
- </library_geometries>
- <library_visual_scenes>
- <visual_scene id="DefaultScene">
- <node id="Box" name="Box">
- <translate> 0 0 0</translate>
- <rotate> 0 0 1 0</rotate>
- <rotate> 0 1 0 0</rotate>
- <rotate> 1 0 0 0</rotate>
- <scale> 1 1 1</scale>
- <instance_geometry url="#box">
- <bind_material>
- <technique_common>
- <instance_material symbol="WHITE" target="#whiteMaterial"/>
- </technique_common>
- </bind_material>
- </instance_geometry>
- </node>
- </visual_scene>
- </library_visual_scenes>
- <scene>
- <instance_visual_scene url="#DefaultScene"/>
- </scene>
-</COLLADA>
-
diff --git a/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro b/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro
deleted file mode 100644
index 1f7a7101..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TARGET = tst_qglcolladafxeffectfactory
-CONFIG += testcase
-TEMPLATE = app
-QT += testlib qt3d
-QT += opengl
-
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../demos/shaderwizard/
-VPATH += ../../../../demos/shaderwizard/
-
-SOURCES += \
- tst_qglcolladafxeffectfactory.cpp
-
-OTHER_FILES += collada_cube.xml
-RESOURCES += tst_qglcolladafxeffectfactory.qrc
diff --git a/tests/auto/threed/qglcolladafxeffectfactory/rose01.jpg b/tests/auto/threed/qglcolladafxeffectfactory/rose01.jpg
deleted file mode 100644
index e65d975b..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/rose01.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp b/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp
deleted file mode 100644
index b60f122b..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglcolladafxeffectfactory.h"
-#include <QXmlStreamReader>
-#include <QColor>
-#include "qgl.h"
-
-QT_BEGIN_NAMESPACE
-class QGLColladaFxEffect;
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGLColladaFxEffect*)
-
-static void cleanupEffectList(QList<QGLColladaFxEffect*> &effects)
-{
- while (effects.count())
- {
- delete effects.back();
- effects.pop_back();
- }
-}
-
-
-
-// Inherit from QGLColladaFxEffectFactory to get access to it's innards
-class tst_QGLColladaFxEffectFactory : public QObject, QGLColladaFxEffectFactory
-{
- Q_OBJECT
-public:
- tst_QGLColladaFxEffectFactory() {}
- ~tst_QGLColladaFxEffectFactory() {}
-
-private slots:
- void create_data();
- void create();
- void processFloatList_data();
- void processFloatList();
- void processFloatListArray_data();
- void processFloatListArray();
- void processColorElement_data();
- void processColorElement();
- void processLibraryImagesElement();
- void loadEffectsFromFile();
- void exportImportEffect_data();
- void exportImportEffect();
-};
-
-
-
-void tst_QGLColladaFxEffectFactory::create_data()
-{
- QTest::addColumn<QString>("fileName");
- QTest::addColumn<int>("effectCount");
-
- QTest::newRow("null") << "" << 0;
- QTest::newRow("nonexistent file") << "nonexistentfile.dae" << 0;
- QTest::newRow("collada cube example") << ":/collada_cube.xml" << 1;
-}
-
-
-
-void tst_QGLColladaFxEffectFactory::create()
-{
- QFETCH(QString, fileName);
- QFETCH(int, effectCount);
-
- QList<QGLColladaFxEffect*> effects = QGLColladaFxEffectFactory::loadEffectsFromFile(fileName);
- QCOMPARE(effects.count(), effectCount);
- cleanupEffectList(effects);
-}
-
-
-
-void tst_QGLColladaFxEffectFactory::processFloatList_data()
-{
- QTest::addColumn<QString>("xmlString");
- QTest::addColumn<QVariant >("expectedResult");
-
- QTest::newRow("null") << "" << QVariant();
-
- QVariant expectedSingleResult = 0.456f;
- QTest::newRow("single_float") << "<floats>0.456</floats>" << expectedSingleResult;
-
- QVariant expectedPrecisionResult = 1.234567f;
- QTest::newRow("seven digit accuracy") << "<floats>1.234567</floats>" << expectedPrecisionResult;
-
- QVariant expected3Dresult = QVector3D(0.0f, 0.3f, 6.6f);
- QTest::newRow("3 floats to vector 3D") << "<floats>0.0 0.3 6.6</floats>" << expected3Dresult;
-
- QVariant expected4DResult = QVector4D(0.0f, 1.1f, 2.2f, 3.3f);
- QTest::newRow("4 floats to vector 4D") << "<floats>0.0 1.1 2.2 3.3</floats>" << expected4DResult;
-
- QVariant expectedColorResult = QVector4D(0.0f, 1.1f, 2.2f, 3.3f);
- QTest::newRow("4 float color to vector 4D") << "<color>0.0 1.1 2.2 3.3</color>" << expectedColorResult;
-}
-
-
-
-void tst_QGLColladaFxEffectFactory::processFloatList()
-{
- QFETCH(QString, xmlString);
- QFETCH(QVariant, expectedResult);
-
- QXmlStreamReader xml(xmlString);
-
- xml.readNext(); // startDocument
- xml.readNext();
-
- QVariant result = QGLColladaFxEffectFactory::processFloatList( xml );
-
- QCOMPARE(result, expectedResult);
-}
-
-void tst_QGLColladaFxEffectFactory::processFloatListArray_data()
-{
- QTest::addColumn<QString>("xmlString");
- QTest::addColumn<QArray<float> >("expectedResult");
-
- QArray<float> expectedSevenDigitArray;
- expectedSevenDigitArray << 1234567.0f << 1.234567f << 76.54321f << 1111.111f << 22222.22f << 7645213.0f;
- QTest::newRow("seven_digits") << "<floats>1234567.0 1.234567 76.54321 1111.111 22222.22 7645213.0</floats>" << expectedSevenDigitArray;
-
-}
-
-void tst_QGLColladaFxEffectFactory::processFloatListArray()
-{
- QFETCH(QString, xmlString);
- QFETCH(QArray<float>, expectedResult);
-
- QXmlStreamReader xml(xmlString);
-
- xml.readNext(); // startDocument
- xml.readNext();
-
- QArray<float> result = QGLColladaFxEffectFactory::processFloatList( xml ).value<QArray<float> >();
-
- QCOMPARE(result, expectedResult);
-
-}
-
-void tst_QGLColladaFxEffectFactory::processColorElement_data()
-{
- QTest::addColumn<QString>("xmlString");
- QTest::addColumn<QColor>("expectedResult");
-
- QColor errorColor = QColor(0, 0, 0, 255);
- QTest::newRow("null") << "" << errorColor;
-
- QColor expectedColor3dResult = QColor::fromRgbF(0.0f, 0.4f, 0.8f);
- QTest::newRow("color 3 floats") << "<color>0.0 0.4 0.8</color>" << expectedColor3dResult;
-
- QColor expectedColor4dResult = QColor::fromRgbF(0.0f, 0.2f, 0.4f, 0.8f);
- QTest::newRow("color 4 floats") << "<color>0.0 0.2 0.4 0.8</color>" << expectedColor4dResult;
-
- QTest::newRow("malformed color 1 float") << "<color>0.5</color>" << errorColor;
- QTest::newRow("malformed color 2 float") << "<color>0.1 0.7</color>" << errorColor;
- QTest::newRow("malformed color 5 float") << "<color>0.1 0.2 0.3 0.4 0.5</color>" << errorColor;
-}
-
-
-
-void tst_QGLColladaFxEffectFactory::processColorElement()
-{
- QFETCH(QString, xmlString);
- QFETCH(QColor, expectedResult);
-
- QXmlStreamReader xml(xmlString);
-
- xml.readNext(); // startDocument
- xml.readNext();
-
- QColor result = QGLColladaFxEffectFactory::processColorElement( xml );
- QCOMPARE(result, expectedResult);
-}
-
-
-void tst_QGLColladaFxEffectFactory::processLibraryImagesElement()
-{
- // Example from Collada Fx 1.4 (escapes and ':' character added):
- QXmlStreamReader xml("<library_images>\
- <image name=\"Rose\">\
- <init_from>\
- :../flowers/rose01.jpg\
- </init_from>\
- </image>\
- </library_images>");
-
- xml.readNext(); // startDocument
- xml.readNext();
-
- ResultState state;
- QGLColladaFxEffectFactory::processLibraryImagesElement( xml, &state );
-
- // The structure is just an implementation detail, but the param and image
- // should be well formed:
- QVariant param = state.paramNames.values().at(0);
- QCOMPARE(param.type(), QVariant::Image);
- QCOMPARE(state.paramNames.value(QLatin1String("Rose")), param);
- QImage image = param.value<QImage>();
- QCOMPARE(image.size(), QSize(50,75));
-}
-
-void tst_QGLColladaFxEffectFactory::loadEffectsFromFile()
-{
- QList<QGLColladaFxEffect*> cubeResult =
- QGLColladaFxEffectFactory::loadEffectsFromFile(QLatin1String(":/collada_cube.xml"));
-
- QCOMPARE(cubeResult.count(), 1);
-
- QGLColladaFxEffect* cubeEffect = cubeResult.at(0);
-
- QEXPECT_FAIL("", "Missing functionality", Continue);
- QCOMPARE(cubeEffect->id(), QLatin1String("whitePhong"));
-
- QCOMPARE(cubeEffect->sid(), QLatin1String("phong1"));
- QVERIFY2(cubeEffect->material()->emittedLight() ==
- QColor::fromRgbF(0.0f, 0.0f, 0.3f, 1.0f), "Emission color doesn't match");
- QVERIFY2(cubeEffect->material()->ambientColor() ==
- QColor::fromRgbF(1.0f, 0.0f, 0.0f, 1.0f), "Ambient color doesn't match");
- QVERIFY2(cubeEffect->material()->diffuseColor() == QColor::fromRgbF(0.0f, 1.0f, 0.0f, 1.0f),
- "Diffuse color doesn't match");
- QVERIFY2(cubeEffect->material()->specularColor() ==
- QColor::fromRgbF(1.0f, 1.0f, 1.0f, 1.0f),
- "Specular color doesn't match");
- QVERIFY2(cubeEffect->material()->shininess() == 20, "Shininess doesn't match");
-}
-
-void tst_QGLColladaFxEffectFactory::exportImportEffect_data()
-{
- QTest::addColumn<QGLColladaFxEffect*>("effect");
- QTest::addColumn<QString>("effectId");
- QTest::addColumn<QString>("techniqueSid");
-
- QGLColladaFxEffect* effect = new QGLColladaFxEffect;
- QTest::newRow("empty effect") << effect << QString::fromLatin1("EmptyEffect") << QString::fromLatin1("EmptyTechnique");
-
- effect = new QGLColladaFxEffect;
- effect->setFragmentShader("test fragment shader");
- effect->setVertexShader("Test vertex shader");
- QGLMaterial* material = new QGLMaterial;
- material->setAmbientColor(QColor(1,2,3));
- material->setDiffuseColor(QColor(2,3,4));
- material->setEmittedLight(QColor(255,255,255));
- material->setShininess(129);
- material->setSpecularColor(QColor(3,4,5));
- effect->setMaterial(material);
-
- QTest::newRow("Test Effect") << effect << QString::fromLatin1("TestEffect") << QString::fromLatin1("TestTechnique");
-}
-
-void tst_QGLColladaFxEffectFactory::exportImportEffect()
-{
- QFETCH(QGLColladaFxEffect*, effect);
- QFETCH(QString, effectId);
- QFETCH(QString, techniqueSid);
- QString colladaEffectString = QGLColladaFxEffectFactory::exportEffect(effect, effectId, techniqueSid);
- QXmlStreamReader xml(colladaEffectString);
-
- QList<QGLColladaFxEffect*> importedEffects = QGLColladaFxEffectFactory::loadEffectsFromXml(xml);
- QCOMPARE(importedEffects.count(), 1);
-
- QGLColladaFxEffect* importedEffect = importedEffects[0];
- QCOMPARE(effect->fragmentShader(), importedEffect->fragmentShader());
- QCOMPARE(effect->vertexShader(), importedEffect->vertexShader());
- QEXPECT_FAIL("Test Effect", "QGLColladaFxEffect import/export does not respect materials", Continue);
- QCOMPARE(effect->material(), importedEffect->material());
- QCOMPARE(effect->supportsPicking(), importedEffect->supportsPicking());
-}
-
-QTEST_APPLESS_MAIN(tst_QGLColladaFxEffectFactory)
-
-#include "tst_qglcolladafxeffectfactory.moc"
diff --git a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.qrc b/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.qrc
deleted file mode 100644
index 8d4efc40..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>collada_cube.xml</file>
- </qresource>
- <qresource prefix="/../flowers">
- <file>rose01.jpg</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/threed/qglcube/qglcube.pro b/tests/auto/threed/qglcube/qglcube.pro
deleted file mode 100644
index 7adc2f24..00000000
--- a/tests/auto/threed/qglcube/qglcube.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TARGET = tst_qglcube
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglcube.cpp
diff --git a/tests/auto/threed/qglcube/tst_qglcube.cpp b/tests/auto/threed/qglcube/tst_qglcube.cpp
deleted file mode 100644
index b63669f7..00000000
--- a/tests/auto/threed/qglcube/tst_qglcube.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include "qglcube.h"
-#include "qglbuilder.h"
-#include "qtest_helpers.h"
-
-class tst_QGLCube : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLCube() {}
- ~tst_QGLCube() {}
-
-private slots:
- void create();
- void size();
-};
-
-#define QGL_CUBE_SIZE (6 * 6 * (3 + 3 + 2))
-static float const cubeVertices[QGL_CUBE_SIZE] = {
- -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
- -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
- -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f,
- -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
-
- -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f,
- -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f,
- 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
-
- 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
- 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f,
- 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
- 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f,
- 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
-
- 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f,
- 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f,
- 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f,
-
- 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
- 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
-
- 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f,
- 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f,
- 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f,
- -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f
-};
-
-static int findVertex(const QGeometryData &ary, const QVector3D &v, const QVector3D &n)
-{
- int result = -1;
- for (int i = 0; i < ary.count() && result == -1; ++i)
- {
- if (qFuzzyCompare(v, ary.vertexAt(i)) && qFuzzyCompare(n, ary.normalAt(i)))
- result = i;
- }
- if (result == -1)
- {
- qDebug() << "Could not find expected vertex" << v << "with normal" << n;
- }
- return result;
-}
-
-void tst_QGLCube::create()
-{
- QGLCube cube;
- QGLBuilder list;
- list.newSection(QGL::Faceted);
- QGLSceneNode *node = list.currentNode();
- list << cube;
- QGLSceneNode *root = list.finalizedSceneNode();
- QGeometryData ary = node->geometry();
- for (int i = 0; i < QGL_CUBE_SIZE; i += 8)
- {
- const QVector3D *vdata = reinterpret_cast<const QVector3D*>(cubeVertices + i);
- const QVector2D *tdata = reinterpret_cast<const QVector2D*>(cubeVertices + i + 6);
- int ix = findVertex(ary, vdata[0], vdata[1]);
- QVERIFY(ix != -1);
- QCOMPARE(ary.texCoordAt(ix), tdata[0]);
- }
- delete root;
-}
-
-void tst_QGLCube::size()
-{
- qreal size0 = 3.2f;
- qreal size1 = 5.2f;
- QGLCube cube(size0);
- QCOMPARE(cube.size(), size0);
- {
- QGLBuilder list;
- list.newSection(QGL::Faceted);
- QGLSceneNode *node = list.currentNode();
- list << cube;
- QGLSceneNode *root = list.finalizedSceneNode();
- QGeometryData ary = node->geometry();
- for (int i = 0, v = 0; i < QGL_CUBE_SIZE; ++v, i += 8)
- {
- const QVector3D *vdata = reinterpret_cast<const QVector3D*>(cubeVertices + i);
- const QVector2D *tdata = reinterpret_cast<const QVector2D*>(cubeVertices + i + 6);
- int ix = findVertex(ary, vdata[0] * size0, vdata[1]);
- QVERIFY(ix != -1);
- QCOMPARE(ary.texCoordAt(ix), tdata[0]);
- }
- delete root;
- }
- cube.setSize(size1);
- {
- QGLBuilder list;
- list.newSection(QGL::Faceted);
- QGLSceneNode *node = list.currentNode();
- list << cube;
- QGLSceneNode *root = list.finalizedSceneNode();
- QGeometryData ary = node->geometry();
- for (int i = 0, v = 0; i < QGL_CUBE_SIZE; ++v, i += 8)
- {
- const QVector3D *vdata = reinterpret_cast<const QVector3D*>(cubeVertices + i);
- const QVector2D *tdata = reinterpret_cast<const QVector2D*>(cubeVertices + i + 6);
- int ix = findVertex(ary, vdata[0] * size1, vdata[1]);
- QVERIFY(ix != -1);
- QCOMPARE(ary.texCoordAt(ix), tdata[0]);
- }
- delete root;
- }
-}
-
-QTEST_APPLESS_MAIN(tst_QGLCube)
-
-#include "tst_qglcube.moc"
diff --git a/tests/auto/threed/qglcylinder/qglcylinder.pro b/tests/auto/threed/qglcylinder/qglcylinder.pro
deleted file mode 100644
index fdfca9e0..00000000
--- a/tests/auto/threed/qglcylinder/qglcylinder.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TARGET = tst_qglcylinder
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglcylinder.cpp
diff --git a/tests/auto/threed/qglcylinder/tst_qglcylinder.cpp b/tests/auto/threed/qglcylinder/tst_qglcylinder.cpp
deleted file mode 100644
index ba6da836..00000000
--- a/tests/auto/threed/qglcylinder/tst_qglcylinder.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include "qglcylinder.h"
-#include "qglbuilder.h"
-
-class tst_QGLCylinder : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLCylinder() {}
- ~tst_QGLCylinder() {}
-
-private slots:
- void create();
- void modify();
- void build();
-
-private:
- bool validateCylinder(QGLSceneNode *node, qreal topDiameter, qreal baseDiameter, qreal height, bool top, bool base);
-};
-
-void tst_QGLCylinder::create()
-{
- //Test all possible constructor parameters to ensure they are actually
- //setting the correct values.
-
- //Defaults
- QGLCylinder cylinder1;
- QCOMPARE(cylinder1.diameterTop(), qreal(1.0f));
- QCOMPARE(cylinder1.diameterBottom(), qreal(1.0f));
- QCOMPARE(cylinder1.height(), qreal(1.0f));
- QCOMPARE(cylinder1.slices(), 6);
- QCOMPARE(cylinder1.layers(), 3);
- QCOMPARE(cylinder1.topEnabled(), true);
- QCOMPARE(cylinder1.baseEnabled(), true);
-
- //Top diameter
- QGLCylinder cylinder2(0.5f);
- QCOMPARE(cylinder2.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder2.diameterBottom(), qreal(1.0f));
- QCOMPARE(cylinder2.height(), qreal(1.0f));
- QCOMPARE(cylinder2.slices(), 6);
- QCOMPARE(cylinder2.layers(), 3);
- QCOMPARE(cylinder2.topEnabled(), true);
- QCOMPARE(cylinder2.baseEnabled(), true);
-
- //Top and Bottom diameter
- QGLCylinder cylinder3(0.5f, 1.5f);
- QCOMPARE(cylinder3.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder3.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder3.height(), qreal(1.0f));
- QCOMPARE(cylinder3.slices(), 6);
- QCOMPARE(cylinder3.layers(), 3);
- QCOMPARE(cylinder3.topEnabled(), true);
- QCOMPARE(cylinder3.baseEnabled(), true);
-
- //Top & Bottom diameter, Height
- QGLCylinder cylinder4(0.5f, 1.5f, 3.0f);
- QCOMPARE(cylinder4.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder4.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder4.height(), qreal(3.0f));
- QCOMPARE(cylinder4.slices(), 6);
- QCOMPARE(cylinder4.layers(), 3);
- QCOMPARE(cylinder4.topEnabled(), true);
- QCOMPARE(cylinder4.baseEnabled(), true);
-
- //Top & Bottom diameter, Height, Slices
- QGLCylinder cylinder5(0.5f, 1.5f, 3.0f, 10);
- QCOMPARE(cylinder5.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder5.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder5.height(), qreal(3.0f));
- QCOMPARE(cylinder5.slices(), 10);
- QCOMPARE(cylinder5.layers(), 3);
- QCOMPARE(cylinder5.topEnabled(), true);
- QCOMPARE(cylinder5.baseEnabled(), true);
-
- //Top & Bottom diameter, Height, Slices, Layers
- QGLCylinder cylinder6(0.5f, 1.5f, 3.0f, 10, 5);
- QCOMPARE(cylinder6.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder6.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder6.height(), qreal(3.0f));
- QCOMPARE(cylinder6.slices(), 10);
- QCOMPARE(cylinder6.layers(), 5);
- QCOMPARE(cylinder6.topEnabled(), true);
- QCOMPARE(cylinder6.baseEnabled(), true);
-
- //Top & Bottom diameter, Height, Slices, Layers, Top disabled
- QGLCylinder cylinder7(0.5f, 1.5f, 3.0f, 10, 5, false);
- QCOMPARE(cylinder7.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder7.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder7.height(), qreal(3.0f));
- QCOMPARE(cylinder7.slices(), 10);
- QCOMPARE(cylinder7.layers(), 5);
- QCOMPARE(cylinder7.topEnabled(), false);
- QCOMPARE(cylinder7.baseEnabled(), true);
-
- //Top & Bottom diameter, Height, Slices, Layers, Top disabled, Bottom disabled.
- QGLCylinder cylinder8(0.5f, 1.5f, 3.0f, 10, 5, false, false);
- QCOMPARE(cylinder8.diameterTop(), qreal(0.5f));
- QCOMPARE(cylinder8.diameterBottom(), qreal(1.5f));
- QCOMPARE(cylinder8.height(), qreal(3.0f));
- QCOMPARE(cylinder8.slices(), 10);
- QCOMPARE(cylinder8.layers(), 5);
- QCOMPARE(cylinder8.topEnabled(), false);
- QCOMPARE(cylinder8.baseEnabled(), false);
-}
-
-void tst_QGLCylinder::modify()
-{
- //Modify all sphere parameters to ensure they're working.
- QGLCylinder cylinder1;
-
- cylinder1.setDiameterTop(0.5f);
- QCOMPARE(cylinder1.diameterTop(), qreal(0.5f));
-
- cylinder1.setDiameterBottom(1.5f);
- QCOMPARE(cylinder1.diameterBottom(), qreal(1.5f));
-
- cylinder1.setHeight(3.0f);
- QCOMPARE(cylinder1.height(), qreal(3.0f));
-
- cylinder1.setSlices(10);
- QCOMPARE(cylinder1.slices(), 10);
-
- cylinder1.setLayers(5);
- QCOMPARE(cylinder1.layers(), 5);
-
- cylinder1.setTopEnabled(false);
- QCOMPARE(cylinder1.topEnabled(), false);
-
- cylinder1.setBaseEnabled(false);
- QCOMPARE(cylinder1.baseEnabled(), false);
-}
-
-// Validates the geometry in a cylinder node to check that all vertices
-// on the top and bottom are at the correct height, and that all normals
-// are of length 1. It also ensures that all points are within the defined
-// top and bottom diameters for the cylinder.
-bool tst_QGLCylinder::validateCylinder(QGLSceneNode *node, qreal topDiameter, qreal baseDiameter, qreal height, bool topAttached, bool baseAttached)
-{
- QGLSceneNode *lid = node->findChild<QGLSceneNode *>("Cylinder Top");
- QGLSceneNode *sides = node->findChild<QGLSceneNode *>("Cylinder Sides");
- QGLSceneNode *base = node->findChild<QGLSceneNode *>("Cylinder Base");
-
- //Top of the cylinder - test the normals and vertical position
- if (topAttached)
- {
- if (!lid) {
- return false;
- }
-
- QGeometryData dataTop = lid->geometry();
- int start = lid->start();
- int count = lid->count();
-
- if (count <= 0) {
- return false;
- }
- QGL::IndexArray indices = dataTop.indices();
-
- for (int index = 0; index < count; ++index) {
- QVector3D v = dataTop.vertexAt(indices.at(index + start));
- QVector3D n = dataTop.normalAt(indices.at(index + start));
- if (v.z()!=height) {
- return false;
- }
- QVector2D p(v.x(), v.y());
- if (qAbs(p.length())>(topDiameter/2.0)) {
- return false;
- }
- if (qAbs(n.length() - 1.0f) >= 0.0001) {
- return false;
- }
- }
- }
-
- //Base of the cylinder - test the normals and vertical position
- if (baseAttached)
- {
- if (!base)
- return false;
- QGeometryData dataBase = sides->geometry();
- int start = sides->start();
- int count = sides->count();
- if (count <= 0)
- return false;
- QGL::IndexArray indices = dataBase.indices();
- for (int index = 0; index < count; ++index) {
- QVector3D v = dataBase.vertexAt(indices.at(index + start));
- QVector3D n = dataBase.normalAt(indices.at(index + start));
- QVector2D p(v.x(), v.y());
- if (qAbs(p.length())>(baseDiameter/2.0)) {
- return false;
- }
- if (qAbs(n.length() - 1.0f) >= 0.0001) {
- return false;
- }
- }
- }
-
- //Sides of the cylinder - just a basic test of the normals here.
- if (!sides) {
- return false;
- }
- QGeometryData dataSides = sides->geometry();
- int start = sides->start();
- int count = sides->count();
-
- if (count <= 0) {
- return false;
- }
- QGL::IndexArray indices = dataSides.indices();
- for (int index = 0; index < count; ++index) {
- QVector3D n = dataSides.normalAt(indices.at(index + start));
- if (qAbs(n.length() - 1.0f) >= 0.0001) {
- return false;
- }
- }
-
- //If we've made it this far, we must have passed the test.
- return true;
-
-}
-
-void tst_QGLCylinder::build()
-{
- QGLBuilder builder1;
- builder1 << QGLCylinder(0.5f, 1.5f, 3.0f);
- QGLSceneNode *root1 = builder1.finalizedSceneNode();
- QVERIFY(validateCylinder(root1, 0.5f, 1.5f, 3.0f, true, true));
- delete root1;
-
- QGLBuilder builder2;
- builder2 << QGLCylinder(0.5f, 1.5f, 3.0f, 6,3,false, false);
- QGLSceneNode *root2 = builder2.finalizedSceneNode();
- QVERIFY(validateCylinder(root2, 0.5f, 1.5f, 3.0f, false, false));
- delete root2;
-}
-
-QTEST_APPLESS_MAIN(tst_QGLCylinder)
-
-#include "tst_qglcylinder.moc"
diff --git a/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro b/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro
deleted file mode 100644
index 3b3b1571..00000000
--- a/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qglindexbuffer
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d opengl
-CONFIG += warn_on
-
-SOURCES += tst_qglindexbuffer.cpp
diff --git a/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp b/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp
deleted file mode 100644
index d34ac0f9..00000000
--- a/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp
+++ /dev/null
@@ -1,477 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglindexbuffer.h"
-#include "qopenglfunctions.h"
-
-class tst_QGLIndexBuffer : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLIndexBuffer() {}
- ~tst_QGLIndexBuffer() {}
-
-private slots:
- void initTestCase();
- void create();
- void replaceIndexes();
- void appendSimple_data();
- void appendSimple();
- void appendCombined_data();
- void appendCombined();
-
-private:
- QArray<ushort> indexesUShort1024;
- QArray<uint> indexesUInt1024;
- QArray<ushort> indexesUShort1024Rev;
- QArray<uint> indexesUInt1024Rev;
-};
-
-void tst_QGLIndexBuffer::initTestCase()
-{
- for (uint index = 0; index < 1024; ++index) {
- indexesUShort1024.append(ushort(index));
- indexesUInt1024.append(index);
- indexesUShort1024Rev.append(ushort(1024 - index));
- indexesUInt1024Rev.append(1024 - index);
- }
-}
-
-void tst_QGLIndexBuffer::create()
-{
- QGLIndexBuffer buf1;
- QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw);
- QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT);
- QVERIFY(buf1.indexesUShort().isEmpty());
- QVERIFY(buf1.indexesUInt().isEmpty());
- QVERIFY(buf1.isEmpty());
- QCOMPARE(buf1.indexCount(), 0);
- QVERIFY(!buf1.buffer().isCreated());
- QVERIFY(!buf1.isUploaded());
-
- // Setting an index array as ushort must stay ushort.
- buf1.setIndexes(indexesUShort1024);
- QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw);
- QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT);
- QVERIFY(buf1.indexesUShort() == indexesUShort1024);
- QVERIFY(buf1.indexesUInt().isEmpty());
- QVERIFY(!buf1.isEmpty());
- QCOMPARE(buf1.indexCount(), 1024);
- QVERIFY(!buf1.buffer().isCreated());
- QVERIFY(!buf1.isUploaded());
-
- // Setting an index array as uint may convert to ushort on
- // embedded systems that don't have GL_OES_element_index_uint.
- buf1.setIndexes(indexesUInt1024);
- QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw);
- if (buf1.elementType() == GL_UNSIGNED_SHORT) {
- QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT);
- QVERIFY(buf1.indexesUShort() == indexesUShort1024);
- QVERIFY(buf1.indexesUInt().isEmpty());
- } else {
- QVERIFY(buf1.elementType() == GL_UNSIGNED_INT);
- QVERIFY(buf1.indexesUShort().isEmpty());
- QVERIFY(buf1.indexesUInt() == indexesUInt1024);
- }
- QVERIFY(!buf1.isEmpty());
- QCOMPARE(buf1.indexCount(), 1024);
- QVERIFY(!buf1.buffer().isCreated());
- QVERIFY(!buf1.isUploaded());
-
- // Set back to ushort again.
- buf1.setIndexes(indexesUShort1024);
- QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw);
- QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT);
- QVERIFY(buf1.indexesUShort() == indexesUShort1024);
- QVERIFY(buf1.indexesUInt().isEmpty());
- QVERIFY(!buf1.isEmpty());
- QCOMPARE(buf1.indexCount(), 1024);
- QVERIFY(!buf1.buffer().isCreated());
- QVERIFY(!buf1.isUploaded());
-}
-
-void tst_QGLIndexBuffer::replaceIndexes()
-{
- QGLIndexBuffer buf1;
- buf1.setIndexes(indexesUShort1024);
- buf1.replaceIndexes(0, indexesUShort1024Rev);
- QCOMPARE(buf1.indexCount(), indexesUShort1024Rev.size());
- QVERIFY(buf1.indexesUShort() == indexesUShort1024Rev);
-
- QArray<ushort> result1(indexesUShort1024Rev);
- result1.replace(512, indexesUShort1024.constData(), indexesUShort1024.size());
- buf1.replaceIndexes(512, indexesUShort1024);
- QVERIFY(buf1.indexesUShort() == result1);
- QCOMPARE(buf1.indexCount(), result1.size());
-
- QGLIndexBuffer buf2;
- buf2.setIndexes(indexesUInt1024);
- buf2.replaceIndexes(0, indexesUInt1024Rev);
- QCOMPARE(buf2.indexCount(), indexesUShort1024Rev.size());
- if (buf2.elementType() == GL_UNSIGNED_SHORT) {
- QVERIFY(buf2.indexesUShort() == indexesUShort1024Rev);
- buf2.replaceIndexes(512, indexesUInt1024);
- QVERIFY(buf2.indexesUShort() == result1);
- QCOMPARE(buf2.indexCount(), result1.size());
- } else {
- QVERIFY(buf2.indexesUInt() == indexesUInt1024Rev);
- QArray<uint> result2(indexesUInt1024Rev);
- result2.replace(512, indexesUInt1024.constData(), indexesUInt1024.size());
- buf2.replaceIndexes(512, indexesUInt1024);
- QVERIFY(buf2.indexesUInt() == result2);
- QCOMPARE(buf2.indexCount(), result2.size());
- }
-}
-
-void tst_QGLIndexBuffer::appendSimple_data()
-{
- QTest::addColumn<int>("buf1Type");
- QTest::addColumn<int>("buf2Type");
-
- QTest::newRow("ushort, ushort")
- << int(GL_UNSIGNED_SHORT) << int(GL_UNSIGNED_SHORT);
- QTest::newRow("ushort, uint")
- << int(GL_UNSIGNED_SHORT) << int(GL_UNSIGNED_INT);
- QTest::newRow("uint, ushort")
- << int(GL_UNSIGNED_INT) << int(GL_UNSIGNED_SHORT);
- QTest::newRow("uint, uint")
- << int(GL_UNSIGNED_INT) << int(GL_UNSIGNED_INT);
-}
-
-void tst_QGLIndexBuffer::appendSimple()
-{
- QFETCH(int, buf1Type);
- QFETCH(int, buf2Type);
-
- QGLIndexBuffer buf1;
- QGLIndexBuffer buf2;
- if (buf1Type == GL_UNSIGNED_SHORT)
- buf1.setIndexes(indexesUShort1024);
- else
- buf1.setIndexes(indexesUInt1024);
- if (buf2Type == GL_UNSIGNED_SHORT)
- buf2.setIndexes(indexesUShort1024Rev);
- else
- buf2.setIndexes(indexesUInt1024Rev);
- buf1.append(buf2, 23);
-
- if (buf1.elementType() == GL_UNSIGNED_SHORT) {
- QArray<ushort> result1(indexesUShort1024);
- for (int index = 0; index < indexesUShort1024Rev.size(); ++index)
- result1.append(indexesUShort1024Rev[index] + 23);
- QVERIFY(buf1.indexesUShort() == result1);
- QCOMPARE(buf1.indexCount(), result1.size());
- } else {
- QArray<uint> result2(indexesUInt1024);
- for (int index = 0; index < indexesUInt1024Rev.size(); ++index)
- result2.append(indexesUInt1024Rev[index] + 23);
- QVERIFY(buf1.indexesUInt() == result2);
- QCOMPARE(buf1.indexCount(), result2.size());
- }
-}
-
-void tst_QGLIndexBuffer::appendCombined_data()
-{
- QTest::addColumn<int>("combineMode");
- QTest::addColumn<int>("offset");
- QTest::addColumn<QString>("buf1Values");
- QTest::addColumn<QString>("buf2Values");
- QTest::addColumn<QString>("resultValues");
-
- QTest::newRow("triangles")
- << int(QGL::Triangles) << 0
- << "0 1 2 3 4 5"
- << "4 5 6 7 8 9"
- << "0 1 2 3 4 5 4 5 6 7 8 9";
-
- QTest::newRow("triangles, empty A")
- << int(QGL::Triangles) << 20
- << ""
- << "4 5 6 7 8"
- << "24 25 26 27 28";
-
- QTest::newRow("triangles, empty B")
- << int(QGL::Triangles) << 10
- << "0 1 2 3 4 5"
- << ""
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle strip, even")
- << int(QGL::TriangleStrip) << 2
- << "0 1 2 3"
- << "0 1 2 3"
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle strip, odd")
- << int(QGL::TriangleStrip) << 0
- << "0 1 2"
- << "1 2 3 4 5"
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle strip, odd reversed")
- << int(QGL::TriangleStrip) << 0
- << "0 1 2"
- << "2 1 3 4 5"
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle strip, no common")
- << int(QGL::TriangleStrip) << 0
- << "0 1 2"
- << "3 4 5"
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle strip, empty A")
- << int(QGL::TriangleStrip) << 0
- << "0 1 2"
- << ""
- << "0 1 2";
-
- QTest::newRow("triangle strip, empty B")
- << int(QGL::TriangleStrip) << 0
- << ""
- << "0 1 2"
- << "0 1 2";
-
- QTest::newRow("line strip")
- << int(QGL::LineStrip) << 0
- << "0 1 2"
- << "2 3 4"
- << "0 1 2 3 4";
-
- QTest::newRow("line strip, offset")
- << int(QGL::LineStrip) << 2
- << "0 1 2"
- << "0 1 2"
- << "0 1 2 3 4";
-
- QTest::newRow("line strip, no common")
- << int(QGL::LineStrip) << 0
- << "0 1 2"
- << "3 4"
- << "0 1 2 3 4";
-
- QTest::newRow("line strip, empty A")
- << int(QGL::LineStrip) << 0
- << ""
- << "0 1 2"
- << "0 1 2";
-
- QTest::newRow("line strip, empty B")
- << int(QGL::LineStrip) << 0
- << "0 1 2"
- << ""
- << "0 1 2";
-
- QTest::newRow("quad strip")
- << int(0x0008) << 0
- << "0 1 2 3"
- << "2 3 4 5"
- << "0 1 2 3 4 5";
-
- QTest::newRow("quad strip, offset")
- << int(0x0008) << 2
- << "0 1 2 3"
- << "0 1 2 3"
- << "0 1 2 3 4 5";
-
- QTest::newRow("quad strip, no common")
- << int(0x0008) << 0
- << "0 1 2 3"
- << "3 2 4 5"
- << "0 1 2 3 3 2 4 5";
-
- QTest::newRow("triangle fan")
- << int(QGL::TriangleFan) << 0
- << "0 1 2 3"
- << "0 3 4 5"
- << "0 1 2 3 4 5";
-
- QTest::newRow("triangle fan, offset")
- << int(QGL::TriangleFan) << 10
- << "10 11 12 13"
- << "0 3 4 5"
- << "10 11 12 13 14 15";
-
- QTest::newRow("triangle fan, no common")
- << int(QGL::TriangleFan) << 0
- << "0 1 2 3"
- << "1 3 4 5"
- << "0 1 2 3 1 3 4 5";
-
- QTest::newRow("triangle fan, no common 2")
- << int(QGL::TriangleFan) << 0
- << "0 1 2 3"
- << "0 2 4 5"
- << "0 1 2 3 0 2 4 5";
-
- QTest::newRow("line strip adjacency")
- << int(QGL::LineStripAdjacency) << 0
- << "0 1 2 3"
- << "1 2 3 4"
- << "0 1 2 3 4";
-
- QTest::newRow("line strip adjacency, offset")
- << int(QGL::LineStripAdjacency) << 10
- << "10 11 12 13"
- << "1 2 3 4"
- << "10 11 12 13 14";
-
- QTest::newRow("line strip adjacency, no common")
- << int(QGL::LineStripAdjacency) << 0
- << "0 1 2 3"
- << "2 3 4 5"
- << "0 1 2 3 2 3 4 5";
-
- QTest::newRow("triangle strip adjacency, even")
- << int(QGL::TriangleStripAdjacency) << 0
- << "1 2 3 4 5 6"
- << "3 1 5 6 7 8"
- << "1 2 3 4 5 6 7 8";
-
- QTest::newRow("triangle strip adjacency, odd")
- << int(QGL::TriangleStripAdjacency) << 0
- << "1 2 3 4 5 6 7 8"
- << "5 3 7 8 9 10"
- << "1 2 3 4 5 6 7 8 9 10";
-
- QTest::newRow("triangle strip adjacency, even again")
- << int(QGL::TriangleStripAdjacency) << 0
- << "1 2 3 4 5 6 7 8 9 10"
- << "7 5 9 10 11 12"
- << "1 2 3 4 5 6 7 8 9 10 11 12";
-
- QTest::newRow("triangle strip adjacency, no common")
- << int(QGL::TriangleStripAdjacency) << 0
- << "1 2 3 4 5 6 7 8 9 10"
- << "5 7 9 10 11 12"
- << "1 2 3 4 5 6 7 8 9 10 5 7 9 10 11 12";
-
- QTest::newRow("triangle strip adjacency, offset")
- << int(QGL::TriangleStripAdjacency) << 100
- << "101 102 103 104 105 106 107 108 109 110"
- << "7 5 9 10 11 12"
- << "101 102 103 104 105 106 107 108 109 110 111 112";
-}
-
-static QArray<ushort> stringToUShortArray(const QString &str)
-{
- QStringList list = str.split(QLatin1String(" "));
- QArray<ushort> array;
- if (str.isEmpty())
- return array;
- foreach (QString s, list)
- array.append(ushort(s.toInt()));
- return array;
-}
-
-static QArray<uint> stringToUIntArray(const QString &str)
-{
- QStringList list = str.split(QLatin1String(" "));
- QArray<uint> array;
- if (str.isEmpty())
- return array;
- foreach (QString s, list)
- array.append(s.toUInt());
- return array;
-}
-
-static bool sameIndexes(const QGLIndexBuffer &buf, const QArray<ushort> &result)
-{
- if (buf.elementType() == GL_UNSIGNED_SHORT) {
- return buf.indexesUShort() == result;
- } else {
- QArray<uint> result2;
- for (int index = 0; index < result.size(); ++index)
- result2.append(result[index]);
- return buf.indexesUInt() == result2;
- }
-}
-
-void tst_QGLIndexBuffer::appendCombined()
-{
- QFETCH(int, combineMode);
- QFETCH(int, offset);
- QFETCH(QString, buf1Values);
- QFETCH(QString, buf2Values);
- QFETCH(QString, resultValues);
-
- // Test ushort, ushort appends.
- QGLIndexBuffer buf1, buf2;
- buf1.setIndexes(stringToUShortArray(buf1Values));
- buf2.setIndexes(stringToUShortArray(buf2Values));
- buf1.append(buf2, uint(offset), QGL::DrawingMode(combineMode));
-
- QArray<ushort> result = stringToUShortArray(resultValues);
- QVERIFY(buf1.indexesUShort() == result);
- QCOMPARE(buf1.indexCount(), result.size());
-
- // Test ushort, uint appends.
- QGLIndexBuffer buf3, buf4;
- buf3.setIndexes(stringToUShortArray(buf1Values));
- buf4.setIndexes(stringToUIntArray(buf2Values));
- buf3.append(buf4, uint(offset), QGL::DrawingMode(combineMode));
-
- QVERIFY(sameIndexes(buf3, result));
- QCOMPARE(buf3.indexCount(), result.size());
-
- // Test uint, ushort appends.
- QGLIndexBuffer buf5, buf6;
- buf5.setIndexes(stringToUIntArray(buf1Values));
- buf6.setIndexes(stringToUShortArray(buf2Values));
- buf5.append(buf6, uint(offset), QGL::DrawingMode(combineMode));
-
- QVERIFY(sameIndexes(buf5, result));
- QCOMPARE(buf5.indexCount(), result.size());
-
- // Test uint, uint appends.
- QGLIndexBuffer buf7, buf8;
- buf7.setIndexes(stringToUIntArray(buf1Values));
- buf8.setIndexes(stringToUIntArray(buf2Values));
- buf7.append(buf8, uint(offset), QGL::DrawingMode(combineMode));
-
- QVERIFY(sameIndexes(buf7, result));
- QCOMPARE(buf7.indexCount(), result.size());
-}
-
-QTEST_MAIN(tst_QGLIndexBuffer)
-
-#include "tst_qglindexbuffer.moc"
diff --git a/tests/auto/threed/qgllightmodel/qgllightmodel.pro b/tests/auto/threed/qgllightmodel/qgllightmodel.pro
deleted file mode 100644
index 589f1059..00000000
--- a/tests/auto/threed/qgllightmodel/qgllightmodel.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qgllightmodel
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qgllightmodel.cpp
diff --git a/tests/auto/threed/qgllightmodel/tst_qgllightmodel.cpp b/tests/auto/threed/qgllightmodel/tst_qgllightmodel.cpp
deleted file mode 100644
index b0b90af1..00000000
--- a/tests/auto/threed/qgllightmodel/tst_qgllightmodel.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qgllightmodel.h"
-
-class tst_QGLLightModel : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLLightModel() {}
- ~tst_QGLLightModel() {}
-
-private slots:
- void create();
- void modify();
-};
-
-void tst_QGLLightModel::create()
-{
- // Test that a newly created object has the correct defaults.
- QGLLightModel model;
- QVERIFY(model.model() == QGLLightModel::OneSided);
- QVERIFY(model.colorControl() == QGLLightModel::SingleColor);
- QVERIFY(model.viewerPosition() == QGLLightModel::ViewerAtInfinity);
- QCOMPARE(model.ambientSceneColor().redF(), 0.2);
- QCOMPARE(model.ambientSceneColor().greenF(), 0.2);
- QCOMPARE(model.ambientSceneColor().blueF(), 0.2);
- QCOMPARE(model.ambientSceneColor().alphaF(), 1.0);
-}
-
-void tst_QGLLightModel::modify()
-{
- // Test modifying each field individually.
- QGLLightModel model;
- QSignalSpy modelSpy(&model, SIGNAL(modelChanged()));
- QSignalSpy controlSpy(&model, SIGNAL(colorControlChanged()));
- QSignalSpy viewerSpy(&model, SIGNAL(viewerPositionChanged()));
- QSignalSpy ambientSpy(&model, SIGNAL(ambientSceneColorChanged()));
- QSignalSpy objectSpy(&model, SIGNAL(lightModelChanged()));
-
- model.setModel(QGLLightModel::TwoSided);
- QVERIFY(model.model() == QGLLightModel::TwoSided);
- QCOMPARE(modelSpy.size(), 1);
- QCOMPARE(objectSpy.size(), 1);
-
- model.setColorControl(QGLLightModel::SeparateSpecularColor);
- QVERIFY(model.colorControl() == QGLLightModel::SeparateSpecularColor);
- QCOMPARE(controlSpy.size(), 1);
- QCOMPARE(objectSpy.size(), 2);
-
- model.setViewerPosition(QGLLightModel::LocalViewer);
- QVERIFY(model.viewerPosition() == QGLLightModel::LocalViewer);
- QCOMPARE(viewerSpy.size(), 1);
- QCOMPARE(objectSpy.size(), 3);
-
- model.setAmbientSceneColor(Qt::red);
- QCOMPARE(model.ambientSceneColor().red(), 255);
- QCOMPARE(model.ambientSceneColor().green(), 0);
- QCOMPARE(model.ambientSceneColor().blue(), 0);
- QCOMPARE(model.ambientSceneColor().alpha(), 255);
- QCOMPARE(ambientSpy.size(), 1);
- QCOMPARE(objectSpy.size(), 4);
-
- // Test that we don't get any side effects between properties.
- QVERIFY(model.model() == QGLLightModel::TwoSided);
- QVERIFY(model.colorControl() == QGLLightModel::SeparateSpecularColor);
- QVERIFY(model.viewerPosition() == QGLLightModel::LocalViewer);
-
- // Set the properties to same values and check for no further signals.
- model.setModel(QGLLightModel::TwoSided);
- model.setColorControl(QGLLightModel::SeparateSpecularColor);
- model.setViewerPosition(QGLLightModel::LocalViewer);
- model.setAmbientSceneColor(Qt::red);
- QCOMPARE(modelSpy.size(), 1);
- QCOMPARE(controlSpy.size(), 1);
- QCOMPARE(viewerSpy.size(), 1);
- QCOMPARE(ambientSpy.size(), 1);
- QCOMPARE(objectSpy.size(), 4);
-}
-
-QTEST_APPLESS_MAIN(tst_QGLLightModel)
-
-#include "tst_qgllightmodel.moc"
diff --git a/tests/auto/threed/qgllightparameters/qgllightparameters.pro b/tests/auto/threed/qgllightparameters/qgllightparameters.pro
deleted file mode 100644
index 9c8fea5d..00000000
--- a/tests/auto/threed/qgllightparameters/qgllightparameters.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qgllightparameters
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qgllightparameters.cpp
diff --git a/tests/auto/threed/qgllightparameters/tst_qgllightparameters.cpp b/tests/auto/threed/qgllightparameters/tst_qgllightparameters.cpp
deleted file mode 100644
index 387e78d3..00000000
--- a/tests/auto/threed/qgllightparameters/tst_qgllightparameters.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qgllightparameters.h"
-#include <QtGui/qmatrix4x4.h>
-
-class tst_QGLLightParameters : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLLightParameters() {}
- ~tst_QGLLightParameters() {}
-
-private slots:
- void create();
- void modify();
- void type();
- void transform();
-};
-
-void tst_QGLLightParameters::create()
-{
- // Test that a newly created object has the correct defaults.
- QGLLightParameters params;
- QVERIFY(params.type() == QGLLightParameters::Directional);
- QVERIFY(params.position() == QVector3D(0, 0, 0));
- QVERIFY(params.direction() == QVector3D(0, 0, 1));
- QVERIFY(params.ambientColor() == QColor(0, 0, 0, 255));
- QVERIFY(params.diffuseColor() == QColor(255, 255, 255, 255));
- QVERIFY(params.specularColor() == QColor(255, 255, 255, 255));
- QVERIFY(params.spotDirection() == QVector3D(0, 0, -1));
- QCOMPARE(params.spotExponent(), (qreal)0.0f);
- QCOMPARE(params.spotAngle(), (qreal)180.0f);
- QCOMPARE(params.spotCosAngle(), (qreal)-1.0f);
- QCOMPARE(params.constantAttenuation(), (qreal)1.0f);
- QCOMPARE(params.linearAttenuation(), (qreal)0.0f);
- QCOMPARE(params.quadraticAttenuation(), (qreal)0.0f);
-}
-
-void tst_QGLLightParameters::modify()
-{
- // Test modifying each field individually.
- QGLLightParameters params;
- QSignalSpy positionSpy(&params, SIGNAL(positionChanged()));
- QSignalSpy directionSpy(&params, SIGNAL(directionChanged()));
- QSignalSpy ambientSpy(&params, SIGNAL(ambientColorChanged()));
- QSignalSpy diffuseSpy(&params, SIGNAL(diffuseColorChanged()));
- QSignalSpy specularSpy(&params, SIGNAL(specularColorChanged()));
- QSignalSpy spotDirectionSpy(&params, SIGNAL(spotDirectionChanged()));
- QSignalSpy spotExponentSpy(&params, SIGNAL(spotExponentChanged()));
- QSignalSpy spotAngleSpy(&params, SIGNAL(spotAngleChanged()));
- QSignalSpy constSpy(&params, SIGNAL(constantAttenuationChanged()));
- QSignalSpy linearSpy(&params, SIGNAL(linearAttenuationChanged()));
- QSignalSpy quadSpy(&params, SIGNAL(quadraticAttenuationChanged()));
- QSignalSpy lightSpy(&params, SIGNAL(lightChanged()));
-
- params.setPosition(QVector3D(1, 2, -3));
- QVERIFY(params.position() == QVector3D(1.0f, 2.0f, -3.0f));
- QVERIFY(params.direction() == QVector3D(0, 0, 0));
- QVERIFY(params.type() == QGLLightParameters::Positional);
- QCOMPARE(positionSpy.size(), 1);
- QCOMPARE(directionSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 1);
-
- params.setDirection(QVector3D(-1, -2, 3));
- QVERIFY(params.position() == QVector3D(0, 0, 0));
- QVERIFY(params.direction() == QVector3D(-1.0f, -2.0f, 3.0f));
- QVERIFY(params.type() == QGLLightParameters::Directional);
- QCOMPARE(positionSpy.size(), 2);
- QCOMPARE(directionSpy.size(), 2);
- QCOMPARE(lightSpy.size(), 2);
-
- params.setAmbientColor(Qt::red);
- QCOMPARE(params.ambientColor().red(), 255);
- QCOMPARE(params.ambientColor().green(), 0);
- QCOMPARE(params.ambientColor().blue(), 0);
- QCOMPARE(params.ambientColor().alpha(), 255);
- QCOMPARE(ambientSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 3);
-
- params.setDiffuseColor(Qt::green);
- QCOMPARE(params.diffuseColor().red(), 0);
- QCOMPARE(params.diffuseColor().green(), 255);
- QCOMPARE(params.diffuseColor().blue(), 0);
- QCOMPARE(params.diffuseColor().alpha(), 255);
- QCOMPARE(diffuseSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 4);
-
- params.setSpecularColor(Qt::black);
- QCOMPARE(params.specularColor().red(), 0);
- QCOMPARE(params.specularColor().green(), 0);
- QCOMPARE(params.specularColor().blue(), 0);
- QCOMPARE(params.specularColor().alpha(), 255);
- QCOMPARE(specularSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 5);
-
- params.setSpotDirection(QVector3D(0, 1, 0));
- QVERIFY(params.spotDirection() == QVector3D(0.0f, 1.0f, 0.0f));
- QCOMPARE(spotDirectionSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 6);
-
- params.setSpotExponent(23.5f);
- QCOMPARE(params.spotExponent(), (qreal)23.5f);
- QCOMPARE(spotExponentSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 7);
-
- params.setSpotAngle(90.0f);
- QCOMPARE(params.spotAngle(), (qreal)90.0f);
- QVERIFY(params.spotCosAngle() <= 0.000001f); // Fuzzy compare is not fuzzy enough!
- QCOMPARE(spotAngleSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 8);
-
- params.setSpotAngle(180.0f);
- QCOMPARE(params.spotCosAngle(), (qreal)-1.0f);
- QCOMPARE(spotAngleSpy.size(), 2);
- QCOMPARE(lightSpy.size(), 9);
-
- params.setConstantAttenuation(16.0f);
- QCOMPARE(params.constantAttenuation(), (qreal)16.0f);
- QCOMPARE(constSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 10);
-
- params.setLinearAttenuation(-3.5f);
- QCOMPARE(params.linearAttenuation(), (qreal)-3.5f);
- QCOMPARE(linearSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 11);
-
- params.setQuadraticAttenuation(4.0f);
- QCOMPARE(params.quadraticAttenuation(), (qreal)4.0f);
- QCOMPARE(quadSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 12);
-
- // Test that we don't get any side effects between properties.
- QVERIFY(params.position() == QVector3D(0, 0, 0));
- QVERIFY(params.direction() == QVector3D(-1.0f, -2.0f, 3.0f));
- QVERIFY(params.type() == QGLLightParameters::Directional);
- QCOMPARE(params.ambientColor().red(), 255);
- QCOMPARE(params.ambientColor().green(), 0);
- QCOMPARE(params.ambientColor().blue(), 0);
- QCOMPARE(params.ambientColor().alpha(), 255);
- QCOMPARE(params.diffuseColor().red(), 0);
- QCOMPARE(params.diffuseColor().green(), 255);
- QCOMPARE(params.diffuseColor().blue(), 0);
- QCOMPARE(params.diffuseColor().alpha(), 255);
- QCOMPARE(params.specularColor().red(), 0);
- QCOMPARE(params.specularColor().green(), 0);
- QCOMPARE(params.specularColor().blue(), 0);
- QCOMPARE(params.specularColor().alpha(), 255);
- QVERIFY(params.spotDirection() == QVector3D(0.0f, 1.0f, 0.0f));
- QCOMPARE(params.spotExponent(), (qreal)23.5f);
- QCOMPARE(params.spotAngle(), (qreal)180.0f);
- QCOMPARE(params.spotCosAngle(), (qreal)-1.0f);
- QCOMPARE(params.constantAttenuation(), (qreal)16.0f);
- QCOMPARE(params.linearAttenuation(), (qreal)-3.5f);
- QCOMPARE(params.quadraticAttenuation(), (qreal)4.0f);
-
- // Set the properties to same values and check for no further signals.
- params.setDirection(QVector3D(-1, -2, 3));
- params.setAmbientColor(Qt::red);
- params.setDiffuseColor(Qt::green);
- params.setSpecularColor(Qt::black);
- params.setSpotDirection(QVector3D(0, 1, 0));
- params.setSpotExponent(23.5f);
- params.setSpotAngle(180.0f);
- params.setConstantAttenuation(16.0f);
- params.setLinearAttenuation(-3.5f);
- params.setQuadraticAttenuation(4.0f);
- QCOMPARE(positionSpy.size(), 2);
- QCOMPARE(directionSpy.size(), 2);
- QCOMPARE(ambientSpy.size(), 1);
- QCOMPARE(diffuseSpy.size(), 1);
- QCOMPARE(specularSpy.size(), 1);
- QCOMPARE(spotDirectionSpy.size(), 1);
- QCOMPARE(spotExponentSpy.size(), 1);
- QCOMPARE(spotAngleSpy.size(), 2);
- QCOMPARE(constSpy.size(), 1);
- QCOMPARE(linearSpy.size(), 1);
- QCOMPARE(quadSpy.size(), 1);
- QCOMPARE(lightSpy.size(), 12);
-
- // Check signal emission when changing from positional to positional.
- params.setPosition(QVector3D(1, 2, -3));
- QCOMPARE(positionSpy.size(), 3);
- QCOMPARE(directionSpy.size(), 3);
- QCOMPARE(lightSpy.size(), 13);
- params.setPosition(QVector3D(1, 2, -3));
- QVERIFY(params.position() == QVector3D(1.0f, 2.0f, -3.0f));
- QVERIFY(params.direction() == QVector3D(0, 0, 0));
- QCOMPARE(positionSpy.size(), 3);
- QCOMPARE(directionSpy.size(), 3);
- QCOMPARE(lightSpy.size(), 13);
- params.setPosition(QVector3D(4, 1, -2));
- QCOMPARE(positionSpy.size(), 4);
- QCOMPARE(directionSpy.size(), 3);
- QCOMPARE(lightSpy.size(), 14);
- QVERIFY(params.position() == QVector3D(4.0f, 1.0f, -2.0f));
- QVERIFY(params.direction() == QVector3D(0, 0, 0));
-}
-
-void tst_QGLLightParameters::type()
-{
- QGLLightParameters params;
- QVERIFY(params.type() == QGLLightParameters::Directional);
- QCOMPARE(params.position(), QVector3D(0.0f, 0.0f, 0.0f));
- QCOMPARE(params.direction(), QVector3D(0.0f, 0.0f, 1.0f));
- params.setDirection(QVector3D(1.0f, 0.0f, 1.0f));
- QVERIFY(params.type() == QGLLightParameters::Directional);
- QCOMPARE(params.position(), QVector3D(0.0f, 0.0f, 0.0f));
- QCOMPARE(params.direction(), QVector3D(1.0f, 0.0f, 1.0f));
- params.setPosition(QVector3D(2.0f, 0.0f, 2.0f));
- QVERIFY(params.type() == QGLLightParameters::Positional);
- QCOMPARE(params.position(), QVector3D(2.0f, 0.0f, 2.0f));
- QCOMPARE(params.direction(), QVector3D(0.0f, 0.0f, 0.0f));
-}
-
-void tst_QGLLightParameters::transform()
-{
- QGLLightParameters params;
- params.setPosition(QVector3D(1, 2, -3));
- params.setSpotDirection(QVector3D(-5, 1, 3));
-
- QMatrix4x4 m;
- m.translate(-5.0f, 1.5f, 0.5f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(2.0f);
-
- QCOMPARE(params.eyePosition(m), m * QVector4D(1, 2, -3, 1));
- QCOMPARE(params.eyeSpotDirection(m), m.mapVector(QVector3D(-5, 1, 3)));
-
- params.setDirection(QVector3D(-1, -2, 3));
- QCOMPARE(params.eyePosition(m), m * QVector4D(-1, -2, 3, 0));
-}
-
-QTEST_APPLESS_MAIN(tst_QGLLightParameters)
-
-#include "tst_qgllightparameters.moc"
diff --git a/tests/auto/threed/qglmaterial/qglmaterial.pro b/tests/auto/threed/qglmaterial/qglmaterial.pro
deleted file mode 100644
index 02882f9a..00000000
--- a/tests/auto/threed/qglmaterial/qglmaterial.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglmaterial
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglmaterial.cpp
-QT += widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qglmaterial/tst_qglmaterial.cpp b/tests/auto/threed/qglmaterial/tst_qglmaterial.cpp
deleted file mode 100644
index 10dc3895..00000000
--- a/tests/auto/threed/qglmaterial/tst_qglmaterial.cpp
+++ /dev/null
@@ -1,726 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtGui/QOpenGLContext>
-#include "qglmaterial.h"
-#include "qglcolormaterial.h"
-#include "qgltwosidedmaterial.h"
-#include "qgllightparameters.h"
-#include "qgllightmodel.h"
-#include "qgltexture2d.h"
-#include "qglcamera.h"
-#include "qglpainter.h"
-#include "qglvertexbundle.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include <QtCore/qeventloop.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-
-#include "qglframebufferobjectsurface.h"
-#include "qglview.h"
-
-class TestWidget;
-
-class tst_QGLMaterial : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLMaterial() : widget(0) {}
- ~tst_QGLMaterial() {}
-
-private slots:
- void initTestCase();
-
- void standardMaterial();
- void textureLayers();
- void colorMaterial();
- void twoSidedMaterial();
-
- void standardMaterialDraw();
- void colorMaterialDraw();
-
- void cleanupTestCase();
-
-private:
- TestWidget *widget;
-};
-
-class TestWidget : public QGLView
-{
- Q_OBJECT
-public:
- TestWidget(QWindow *parent = 0);
- ~TestWidget();
-
- bool runTest(QGLAbstractMaterial *mat, int timeout = 5000);
- bool sameColor(const QColor &color) const;
-
- void setClearColor(const QColor &color) { clearColor = color; }
-
-protected:
- void initializeGL();
- void paintGL();
-
-private:
- QGLCamera camera;
- QGLVertexBundle bundle;
- QGLAbstractMaterial *material;
- QEventLoop *eventLoop;
- bool paintDone;
- QColor pixel;
- QColor clearColor;
-};
-
-TestWidget::TestWidget(QWindow *parent)
- : QGLView(parent)
- , material(0)
- , eventLoop(0)
- , paintDone(false)
- , clearColor(Qt::black)
-{
- QVector3DArray positions;
- QVector3DArray normals;
- QVector2DArray texCoords;
-
- positions.append(QVector3D(-0.5, -0.5, 0.0));
- positions.append(QVector3D(0.5, -0.5, 0.0));
- positions.append(QVector3D(0.5, 0.5, 0.0));
- positions.append(QVector3D(-0.5, 0.5, 0.0));
-
- normals.append(QVector3D(0, 0, 1));
- normals.append(QVector3D(0, 0, 1));
- normals.append(QVector3D(0, 0, 1));
- normals.append(QVector3D(0, 0, 1));
-
- texCoords.append(QVector2D(0.0f, 0.0f));
- texCoords.append(QVector2D(1.0f, 0.0f));
- texCoords.append(QVector2D(1.0f, 1.0f));
- texCoords.append(QVector2D(0.0f, 1.0f));
-
- bundle.addAttribute(QGL::Position, positions);
- bundle.addAttribute(QGL::Normal, normals);
- bundle.addAttribute(QGL::TextureCoord0, texCoords);
-}
-
-TestWidget::~TestWidget()
-{
-}
-
-bool TestWidget::runTest(QGLAbstractMaterial *mat, int timeout)
-{
- material = mat;
- paintDone = false;
- pixel = QColor();
- eventLoop = new QEventLoop(this);
- QTimer::singleShot(timeout, eventLoop, SLOT(quit()));
- if (!isVisible()) {
- show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(this);
-#endif
- } else {
- update();
- }
- if (!paintDone)
- eventLoop->exec();
- delete eventLoop;
- material = 0;
- eventLoop = 0;
- return paintDone;
-}
-
-bool TestWidget::sameColor(const QColor &color) const
-{
- if (!pixel.isValid()) {
- qWarning("did not get a valid pixel");
- return false;
- }
- if (qAbs(pixel.red() - color.red()) <= 16 &&
- qAbs(pixel.green() - color.green()) <= 16 &&
- qAbs(pixel.blue() - color.blue()) <= 16)
- return true;
- qWarning() << "pixel color does not match, actual:"
- << pixel.name() << "expected:" << color.name();
- return false;
-}
-
-void TestWidget::initializeGL()
-{
- bundle.upload();
-
- QGLPainter painter(this);
- if (painter.hasOpenGLFeature(QOpenGLFunctions::BlendColor))
- painter.glBlendColor(0, 0, 0, 0);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if (painter.hasOpenGLFeature(QOpenGLFunctions::BlendEquation))
- painter.glBlendEquation(GL_FUNC_ADD);
- else if (painter.hasOpenGLFeature(QOpenGLFunctions::BlendEquationSeparate))
- painter.glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
-}
-
-void TestWidget::paintGL()
-{
- QGLPainter painter(this);
- QOpenGLFramebufferObject fbo(512, 512);
- QGLFramebufferObjectSurface surf(&fbo);
-
- surf.activate();
-
- painter.setClearColor(clearColor);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- painter.setCamera(&camera);
-
- painter.clearAttributes();
- painter.setVertexBundle(bundle);
-
- if (material) {
- material->bind(&painter);
- material->prepareToDraw(&painter, painter.attributes());
- painter.draw(QGL::TriangleFan, 4);
- material->release(&painter, 0);
- }
-
- surf.deactivate();
-
- QImage capture = fbo.toImage();
-
- if (capture.width() > 0 && capture.height() > 0)
- pixel = QColor(capture.pixel(capture.width() / 2, capture.height() / 2));
-
- if (!paintDone && eventLoop) {
- paintDone = true;
- eventLoop->quit();
- }
-}
-
-void tst_QGLMaterial::initTestCase()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- widget = new TestWidget();
-}
-
-void tst_QGLMaterial::cleanupTestCase()
-{
- delete widget;
-}
-
-static inline bool fuzzyCompare(qreal x, qreal y)
-{
- return qAbs(x - y) <= 0.00001;
-}
-
-void tst_QGLMaterial::standardMaterial()
-{
- // Test that a newly created object has the correct defaults.
- QGLMaterial mat1;
- QVERIFY(fuzzyCompare(mat1.ambientColor().redF(), qreal(0.2f)));
- QVERIFY(fuzzyCompare(mat1.ambientColor().greenF(), qreal(0.2f)));
- QVERIFY(fuzzyCompare(mat1.ambientColor().blueF(), qreal(0.2f)));
- QVERIFY(fuzzyCompare(mat1.ambientColor().alphaF(), qreal(1.0f)));
- QVERIFY(fuzzyCompare(mat1.diffuseColor().redF(), qreal(0.8f)));
- QVERIFY(fuzzyCompare(mat1.diffuseColor().greenF(), qreal(0.8f)));
- QVERIFY(fuzzyCompare(mat1.diffuseColor().blueF(), qreal(0.8f)));
- QVERIFY(fuzzyCompare(mat1.diffuseColor().alphaF(), qreal(1.0f)));
- QCOMPARE(mat1.specularColor().red(), 0);
- QCOMPARE(mat1.specularColor().green(), 0);
- QCOMPARE(mat1.specularColor().blue(), 0);
- QCOMPARE(mat1.specularColor().alpha(), 255);
- QCOMPARE(mat1.emittedLight().red(), 0);
- QCOMPARE(mat1.emittedLight().green(), 0);
- QCOMPARE(mat1.emittedLight().blue(), 0);
- QCOMPARE(mat1.emittedLight().alpha(), 255);
- QCOMPARE(mat1.shininess(), qreal(0));
- QVERIFY(!mat1.isTransparent());
-
- // Test modifying each field individually, including expected signals.
- QGLMaterial mat2;
- QSignalSpy ambientSpy(&mat2, SIGNAL(ambientColorChanged()));
- QSignalSpy diffuseSpy(&mat2, SIGNAL(diffuseColorChanged()));
- QSignalSpy specularSpy(&mat2, SIGNAL(specularColorChanged()));
- QSignalSpy emittedSpy(&mat2, SIGNAL(emittedLightChanged()));
- QSignalSpy shininessSpy(&mat2, SIGNAL(shininessChanged()));
- QSignalSpy texturesSpy(&mat2, SIGNAL(texturesChanged()));
- QSignalSpy materialSpy(&mat2, SIGNAL(materialChanged()));
- mat2.setAmbientColor(Qt::green);
- QCOMPARE(mat2.ambientColor().red(), 0);
- QCOMPARE(mat2.ambientColor().green(), 255);
- QCOMPARE(mat2.ambientColor().blue(), 0);
- QCOMPARE(mat2.ambientColor().alpha(), 255);
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 0);
- QCOMPARE(specularSpy.count(), 0);
- QCOMPARE(emittedSpy.count(), 0);
- QCOMPARE(shininessSpy.count(), 0);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 1);
- mat2.setDiffuseColor(Qt::blue);
- QCOMPARE(mat2.diffuseColor().red(), 0);
- QCOMPARE(mat2.diffuseColor().green(), 0);
- QCOMPARE(mat2.diffuseColor().blue(), 255);
- QCOMPARE(mat2.diffuseColor().alpha(), 255);
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 1);
- QCOMPARE(specularSpy.count(), 0);
- QCOMPARE(emittedSpy.count(), 0);
- QCOMPARE(shininessSpy.count(), 0);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 2);
- mat2.setSpecularColor(Qt::cyan);
- QCOMPARE(mat2.specularColor().red(), 0);
- QCOMPARE(mat2.specularColor().green(), 255);
- QCOMPARE(mat2.specularColor().blue(), 255);
- QCOMPARE(mat2.specularColor().alpha(), 255);
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 1);
- QCOMPARE(specularSpy.count(), 1);
- QCOMPARE(emittedSpy.count(), 0);
- QCOMPARE(shininessSpy.count(), 0);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 3);
- mat2.setEmittedLight(Qt::white);
- QCOMPARE(mat2.emittedLight().red(), 255);
- QCOMPARE(mat2.emittedLight().green(), 255);
- QCOMPARE(mat2.emittedLight().blue(), 255);
- QCOMPARE(mat2.emittedLight().alpha(), 255);
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 1);
- QCOMPARE(specularSpy.count(), 1);
- QCOMPARE(emittedSpy.count(), 1);
- QCOMPARE(shininessSpy.count(), 0);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 4);
- mat2.setShininess(128);
- QCOMPARE(mat2.shininess(), qreal(128));
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 1);
- QCOMPARE(specularSpy.count(), 1);
- QCOMPARE(emittedSpy.count(), 1);
- QCOMPARE(shininessSpy.count(), 1);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 5);
-
- // Modify to the same values and check for no further signals.
- mat2.setAmbientColor(Qt::green);
- mat2.setDiffuseColor(Qt::blue);
- mat2.setSpecularColor(Qt::cyan);
- mat2.setEmittedLight(Qt::white);
- mat2.setShininess(128);
- QCOMPARE(ambientSpy.count(), 1);
- QCOMPARE(diffuseSpy.count(), 1);
- QCOMPARE(specularSpy.count(), 1);
- QCOMPARE(emittedSpy.count(), 1);
- QCOMPARE(shininessSpy.count(), 1);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 5);
-
- // Check clamping of shininess to the range 0..128.
- mat1.setShininess(-0.5f);
- QCOMPARE(mat1.shininess(), qreal(0.0f));
- mat1.setShininess(128.5f);
- QCOMPARE(mat1.shininess(), qreal(128.0f));
-
- // Test that we don't get any side effects between properties.
- QCOMPARE(mat2.ambientColor().red(), 0);
- QCOMPARE(mat2.ambientColor().green(), 255);
- QCOMPARE(mat2.ambientColor().blue(), 0);
- QCOMPARE(mat2.ambientColor().alpha(), 255);
- QCOMPARE(mat2.diffuseColor().red(), 0);
- QCOMPARE(mat2.diffuseColor().green(), 0);
- QCOMPARE(mat2.diffuseColor().blue(), 255);
- QCOMPARE(mat2.diffuseColor().alpha(), 255);
- QCOMPARE(mat2.specularColor().red(), 0);
- QCOMPARE(mat2.specularColor().green(), 255);
- QCOMPARE(mat2.specularColor().blue(), 255);
- QCOMPARE(mat2.specularColor().alpha(), 255);
- QCOMPARE(mat2.emittedLight().red(), 255);
- QCOMPARE(mat2.emittedLight().green(), 255);
- QCOMPARE(mat2.emittedLight().blue(), 255);
- QCOMPARE(mat2.emittedLight().alpha(), 255);
- QCOMPARE(mat2.shininess(), qreal(128));
-
- // Test the material fetch functions from QGLAbstractMaterial.
- QVERIFY(mat1.front() == &mat1);
- QVERIFY(mat1.back() == 0);
- QVERIFY(mat2.front() == &mat2);
- QVERIFY(mat2.back() == 0);
-
- // Test setting a pseudo-flat color via QGLMaterial::setColor().
- mat2.setColor(QColor::fromRgbF(0.2f, 0.8f, 0.5f, 0.7f));
- QVERIFY(fuzzyCompare(mat2.ambientColor().redF(), qreal(0.2f * 0.2f)));
- QVERIFY(fuzzyCompare(mat2.ambientColor().greenF(), qreal(0.2f * 0.8f)));
- QVERIFY(fuzzyCompare(mat2.ambientColor().blueF(), qreal(0.2f * 0.5f)));
- QVERIFY(fuzzyCompare(mat2.ambientColor().alphaF(), qreal(0.7f)));
- QVERIFY(fuzzyCompare(mat2.diffuseColor().redF(), qreal(0.8f * 0.2f)));
- QVERIFY(fuzzyCompare(mat2.diffuseColor().greenF(), qreal(0.8f * 0.8f)));
- QVERIFY(fuzzyCompare(mat2.diffuseColor().blueF(), qreal(0.8f * 0.5f)));
- QVERIFY(fuzzyCompare(mat2.diffuseColor().alphaF(), qreal(0.7f)));
- QCOMPARE(ambientSpy.count(), 2);
- QCOMPARE(diffuseSpy.count(), 2);
- QCOMPARE(specularSpy.count(), 1);
- QCOMPARE(emittedSpy.count(), 1);
- QCOMPARE(shininessSpy.count(), 1);
- QCOMPARE(texturesSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 6);
-}
-
-void tst_QGLMaterial::textureLayers()
-{
- QGLMaterial mat1;
- QCOMPARE(mat1.textureLayerCount(), 0);
- QVERIFY(mat1.texture() == 0);
- QVERIFY(mat1.texture(3) == 0);
-
- QSignalSpy texturesSpy(&mat1, SIGNAL(texturesChanged()));
- QSignalSpy materialSpy(&mat1, SIGNAL(materialChanged()));
-
- QGLTexture2D *tex1 = new QGLTexture2D(this);
- QSignalSpy tex1Spy(tex1, SIGNAL(destroyed()));
- mat1.setTexture(tex1);
- QCOMPARE(texturesSpy.count(), 1);
- QCOMPARE(materialSpy.count(), 1);
- QCOMPARE(mat1.textureLayerCount(), 1);
- QVERIFY(mat1.texture() == tex1);
-
- QGLTexture2D *tex2 = new QGLTexture2D(this);
- mat1.setTexture(tex2, 3);
- QCOMPARE(texturesSpy.count(), 2);
- QCOMPARE(materialSpy.count(), 2);
- QCOMPARE(mat1.textureLayerCount(), 4);
- QVERIFY(mat1.texture() == tex1);
- QVERIFY(mat1.texture(1) == 0);
- QVERIFY(mat1.texture(2) == 0);
- QVERIFY(mat1.texture(3) == tex2);
-
- QVERIFY(mat1.textureCombineMode() == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(2) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(3) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(-32) == QGLMaterial::Modulate);
-
- mat1.setTextureCombineMode(QGLMaterial::Decal);
- QCOMPARE(texturesSpy.count(), 3);
- QCOMPARE(materialSpy.count(), 3);
-
- QVERIFY(mat1.textureCombineMode() == QGLMaterial::Decal);
- QVERIFY(mat1.textureCombineMode(2) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(3) == QGLMaterial::Modulate);
-
- mat1.setTextureCombineMode(QGLMaterial::Replace, 3);
- QCOMPARE(texturesSpy.count(), 4);
- QCOMPARE(materialSpy.count(), 4);
-
- QVERIFY(mat1.textureCombineMode() == QGLMaterial::Decal);
- QVERIFY(mat1.textureCombineMode(2) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(3) == QGLMaterial::Replace);
-
- mat1.setTextureCombineMode(QGLMaterial::Modulate, 0);
- QCOMPARE(texturesSpy.count(), 5);
- QCOMPARE(materialSpy.count(), 5);
-
- QVERIFY(mat1.textureCombineMode() == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(2) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(3) == QGLMaterial::Replace);
-
- QVERIFY(!mat1.textureUrl().isValid());
- QVERIFY(!mat1.textureUrl(2).isValid());
- QVERIFY(!mat1.textureUrl(3).isValid());
-
- // This will delete the texture object and replace it with a new one.
- QTest::ignoreMessage(QtWarningMsg, "Network URLs not yet supported");
- mat1.setTextureUrl(QUrl(QLatin1String("foo://bar.com/texture.png")));
- QCOMPARE(tex1Spy.count(), 1);
- QCOMPARE(texturesSpy.count(), 6);
- QCOMPARE(materialSpy.count(), 6);
- QVERIFY(mat1.texture() != 0);
- QVERIFY(mat1.texture()->url() == QUrl(QLatin1String("foo://bar.com/texture.png")));
-
- // Setting the url to empty will delete the texture object entirely.
- QSignalSpy tex3Spy(mat1.texture(), SIGNAL(destroyed()));
- mat1.setTextureUrl(QUrl());
- QCOMPARE(tex3Spy.count(), 1);
- QCOMPARE(texturesSpy.count(), 7);
- QCOMPARE(materialSpy.count(), 7);
- QVERIFY(mat1.texture() == 0);
-
- // Changing properties to the same thing should do nothing.
- mat1.setTexture(tex2, 3);
- mat1.setTextureCombineMode(QGLMaterial::Replace, 3);
- mat1.setTextureUrl(QUrl());
-
- // Check final texture assignments and properties.
- QVERIFY(mat1.texture() == 0);
- QVERIFY(mat1.texture(1) == 0);
- QVERIFY(mat1.texture(2) == 0);
- QVERIFY(mat1.texture(3) == tex2);
- QVERIFY(mat1.textureCombineMode() == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(2) == QGLMaterial::Modulate);
- QVERIFY(mat1.textureCombineMode(3) == QGLMaterial::Replace);
- QCOMPARE(mat1.textureLayerCount(), 4);
-}
-
-void tst_QGLMaterial::colorMaterial()
-{
- QGLColorMaterial mat1;
- QVERIFY(mat1.color() == QColor(Qt::white));
- QVERIFY(!mat1.isTransparent());
-
- QSignalSpy colorSpy(&mat1, SIGNAL(colorChanged()));
- QSignalSpy materialSpy(&mat1, SIGNAL(materialChanged()));
-
- mat1.setColor(Qt::red);
- QCOMPARE(colorSpy.count(), 1);
- QCOMPARE(materialSpy.count(), 1);
- QVERIFY(mat1.color() == QColor(Qt::red));
-
- mat1.setColor(Qt::red);
- QCOMPARE(colorSpy.count(), 1);
- QCOMPARE(materialSpy.count(), 1);
-
- mat1.setColor(QColor(24, 56, 98, 43));
- QVERIFY(mat1.isTransparent());
-}
-
-void tst_QGLMaterial::twoSidedMaterial()
-{
- QGLTwoSidedMaterial mat1;
- QVERIFY(mat1.front() == 0);
- QVERIFY(mat1.back() == 0);
-
- QSignalSpy frontSpy(&mat1, SIGNAL(frontChanged()));
- QSignalSpy backSpy(&mat1, SIGNAL(backChanged()));
- QSignalSpy materialSpy(&mat1, SIGNAL(materialChanged()));
-
- QGLMaterial mat2;
- QGLMaterial mat3;
- mat1.setFront(&mat2);
- QCOMPARE(frontSpy.count(), 1);
- QCOMPARE(backSpy.count(), 0);
- QCOMPARE(materialSpy.count(), 1);
- mat1.setBack(&mat3);
- QCOMPARE(frontSpy.count(), 1);
- QCOMPARE(backSpy.count(), 1);
- QCOMPARE(materialSpy.count(), 2);
- QVERIFY(mat1.front() == &mat2);
- QVERIFY(mat1.back() == &mat3);
-
- mat2.setAmbientColor(Qt::red);
- QCOMPARE(materialSpy.count(), 3);
-
- mat3.setAmbientColor(Qt::green);
- QCOMPARE(materialSpy.count(), 4);
-
- QGLMaterial mat4;
- QGLMaterial mat5;
-
- mat1.setFront(&mat4);
- QCOMPARE(frontSpy.count(), 2);
- QCOMPARE(backSpy.count(), 1);
- QCOMPARE(materialSpy.count(), 5);
-
- mat2.setAmbientColor(Qt::blue);
- QCOMPARE(materialSpy.count(), 5);
-
- mat1.setBack(&mat5);
- QCOMPARE(frontSpy.count(), 2);
- QCOMPARE(backSpy.count(), 2);
- QCOMPARE(materialSpy.count(), 6);
- QVERIFY(mat1.front() == &mat4);
- QVERIFY(mat1.back() == &mat5);
-
- mat3.setAmbientColor(Qt::cyan);
- QCOMPARE(materialSpy.count(), 6);
-
- mat1.setFront(&mat4);
- mat1.setBack(&mat5);
- QCOMPARE(frontSpy.count(), 2);
- QCOMPARE(backSpy.count(), 2);
- QCOMPARE(materialSpy.count(), 6);
-
- mat1.setFront(0);
- QCOMPARE(frontSpy.count(), 3);
- QCOMPARE(backSpy.count(), 2);
- QCOMPARE(materialSpy.count(), 7);
- mat1.setBack(0);
- QCOMPARE(frontSpy.count(), 3);
- QCOMPARE(backSpy.count(), 3);
- QCOMPARE(materialSpy.count(), 8);
- QVERIFY(mat1.front() == 0);
- QVERIFY(mat1.back() == 0);
-
- mat1.setFront(&mat2);
- mat1.setBack(&mat2);
- QCOMPARE(frontSpy.count(), 4);
- QCOMPARE(backSpy.count(), 4);
- QCOMPARE(materialSpy.count(), 10);
-
- mat2.setAmbientColor(Qt::white);
- QCOMPARE(materialSpy.count(), 11);
-}
-
-static inline QVector4D colorToVector4D(const QColor &color)
-{
- return QVector4D(color.redF(), color.greenF(),
- color.blueF(), color.alphaF());
-}
-
-static inline qreal clampRange(qreal value)
-{
- if (value < 0.0f)
- return 0.0f;
- else if (value > 1.0f)
- return 1.0f;
- else
- return value;
-}
-
-static inline QColor vector4DToColor(const QVector4D &value, qreal alpha)
-{
- return QColor::fromRgbF(clampRange(value.x()),
- clampRange(value.y()),
- clampRange(value.z()),
- alpha);
-}
-
-// Evaluate the standard GL lighting algorithm to determine what the
-// lit pixel on the screen will be with the supplied parameters.
-static QColor litColor(const QGLMaterial &material)
-{
- QGLLightParameters light;
- QGLLightModel model;
-
- QVector4D color = colorToVector4D(material.emittedLight());
- color += colorToVector4D(material.ambientColor()) *
- colorToVector4D(model.ambientSceneColor());
- QVector4D scolor(0, 0, 0, 0);
-
- QVector3D normal(0, 0, 1);
- QVector3D vertex(-0.5f, -0.5f, 0.0f);
-
- QVector3D toEye;
- if (model.viewerPosition() == QGLLightModel::ViewerAtInfinity)
- toEye = QVector3D(0, 0, 1);
- else
- toEye = (-vertex).normalized();
-
- QVector3D toLight;
- QVector4D pli = light.eyePosition(QMatrix4x4());
- if (pli.w() == 0.0f)
- toLight = pli.toVector3D().normalized();
- else
- toLight = (pli.toVector3D() - vertex).normalized();
-
- qreal angle = qMax(QVector3D::dotProduct(normal, toLight), qreal(0.0f));
-
- QVector4D adcomponent = colorToVector4D(material.ambientColor()) *
- colorToVector4D(light.ambientColor());
- adcomponent += angle * colorToVector4D(material.diffuseColor()) *
- colorToVector4D(light.diffuseColor());
-
- QVector4D scomponent;
- if (angle != 0.0f) {
- QVector3D h = (toLight + toEye).normalized();
- angle = qMax(QVector3D::dotProduct(normal, h), qreal(0.0f));
- if (material.shininess() != 0.0f) {
- scomponent = qPow(angle, material.shininess()) *
- colorToVector4D(material.specularColor()) *
- colorToVector4D(light.specularColor());
- } else {
- scomponent = colorToVector4D(material.specularColor()) *
- colorToVector4D(light.specularColor());
- }
- } else {
- scomponent = QVector4D(0, 0, 0, 0);
- }
-
- if (light.spotAngle() != 180.0f) {
- qreal spot = qMax(QVector3D::dotProduct
- (vertex - pli.toVector3D(), light.spotDirection()), qreal(0.0f));
- if (spot < light.spotCosAngle()) {
- adcomponent = QVector4D(0, 0, 0, 0);
- scomponent = QVector4D(0, 0, 0, 0);
- } else {
- spot = qPow(spot, light.spotExponent());
- adcomponent *= spot;
- scomponent *= spot;
- }
- }
-
- if (pli.w() != 0.0f) {
- qreal attenuation = light.constantAttenuation();
- qreal len = (pli.toVector3D() - vertex).length();
- attenuation += light.linearAttenuation() * len;
- attenuation += light.quadraticAttenuation() * len * len;
- color += adcomponent / attenuation;
- scolor += scomponent / attenuation;
- } else {
- color += adcomponent;
- scolor += scomponent;
- }
-
- return vector4DToColor(color + scolor, material.diffuseColor().alphaF());
-}
-
-void tst_QGLMaterial::standardMaterialDraw()
-{
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QGLMaterial mat1;
- QVERIFY(widget->runTest(&mat1));
- QVERIFY(widget->sameColor(litColor(mat1)));
-}
-
-void tst_QGLMaterial::colorMaterialDraw()
-{
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QGLColorMaterial mat1;
- mat1.setColor(Qt::blue);
- QVERIFY(widget->runTest(&mat1));
- QVERIFY(widget->sameColor(Qt::blue));
-}
-
-QTEST_MAIN(tst_QGLMaterial)
-
-#include "tst_qglmaterial.moc"
diff --git a/tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro b/tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro
deleted file mode 100644
index 98843570..00000000
--- a/tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qglmaterialcollection
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglmaterialcollection.cpp
diff --git a/tests/auto/threed/qglmaterialcollection/tst_qglmaterialcollection.cpp b/tests/auto/threed/qglmaterialcollection/tst_qglmaterialcollection.cpp
deleted file mode 100644
index 24ecacb1..00000000
--- a/tests/auto/threed/qglmaterialcollection/tst_qglmaterialcollection.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglmaterialcollection.h"
-
-class tst_QGLMaterialCollection : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLMaterialCollection() : destroyCount(0) {}
- ~tst_QGLMaterialCollection() {}
-
-private slots:
- void simple();
- void addMaterial();
- void ownership();
- void markUsed();
-
-public slots:
- void materialDestroyed() { ++destroyCount; }
-
-private:
- int destroyCount;
-};
-
-// Simple sanity check on the collection.
-void tst_QGLMaterialCollection::simple()
-{
- QGLMaterialCollection *coll = new QGLMaterialCollection();
- QVERIFY(coll->isEmpty());
- QCOMPARE(coll->size(), 0);
- QVERIFY(!coll->material(0));
- QCOMPARE(coll->indexOf(QLatin1String("foo")), -1);
-
- destroyCount = 0;
-
- QGLMaterial *mat = new QGLMaterial(this);
- mat->setObjectName(QLatin1String("foo"));
- connect(mat, SIGNAL(destroyed()), this, SLOT(materialDestroyed()));
- QCOMPARE(coll->addMaterial(mat), 0);
- QVERIFY(mat->parent() == coll); // Ownership transfers to collection.
-
- QVERIFY(!coll->isEmpty());
- QCOMPARE(coll->size(), 1);
- QVERIFY(coll->material(0) == mat);
- QCOMPARE(coll->indexOf(QLatin1String("foo")), 0);
- QCOMPARE(coll->indexOf(QLatin1String("bar")), -1);
-
- QCOMPARE(destroyCount, 0);
- delete coll;
- QCOMPARE(destroyCount, 1); // Check that the material was destroyed.
-}
-
-// Test adding lots of materials and then looking them up.
-// Also acts as a torture test for the underlying data structures.
-void tst_QGLMaterialCollection::addMaterial()
-{
- QGLMaterialCollection *coll = new QGLMaterialCollection();
-
- const int Size = 2048;
-
- QGLMaterial **materials = new QGLMaterial *[Size];
- for (int index = 0; index < Size; ++index) {
- QGLMaterial *mat = new QGLMaterial();
- mat->setObjectName(QString::number(index));
- connect(mat, SIGNAL(destroyed()), this, SLOT(materialDestroyed()));
- materials[index] = mat;
- QCOMPARE(coll->addMaterial(mat), index);
- }
- QCOMPARE(coll->size(), Size);
- QVERIFY(!coll->isEmpty());
-
- for (int index = 0; index < Size; ++index) {
- QString name = QString::number(index);
- QVERIFY(coll->material(index) == materials[index]);
- QVERIFY(coll->material(name) == materials[index]);
- QVERIFY(coll->contains(materials[index]));
- QVERIFY(coll->contains(name));
- QCOMPARE(coll->indexOf(materials[index]), index);
- QCOMPARE(coll->indexOf(name), index);
- QCOMPARE(coll->materialName(index), name);
- }
-
- QGLMaterial *mat = new QGLMaterial();
-
- QVERIFY(!coll->material(-1));
- QVERIFY(!coll->material(coll->size()));
- QVERIFY(!coll->contains(0));
- QVERIFY(!coll->contains(mat));
- QVERIFY(!coll->contains(QLatin1String("foo")));
- QCOMPARE(coll->indexOf(0), -1);
- QCOMPARE(coll->indexOf(mat), -1);
- QCOMPARE(coll->indexOf(QLatin1String("foo")), -1);
-
- delete mat;
-
- destroyCount = 0;
- delete coll;
- QCOMPARE(destroyCount, Size);
-}
-
-// Test collection ownership.
-void tst_QGLMaterialCollection::ownership()
-{
- QGLMaterialCollection coll;
-
- QGLMaterial *mat = new QGLMaterial(this);
- mat->setObjectName(QLatin1String("foo"));
-
- QGLMaterial *mat2 = new QGLMaterial(this);
- mat2->setObjectName(QLatin1String("bar"));
-
- // Adding the same material multiple times returns the same index.
- QCOMPARE(coll.addMaterial(mat), 0);
- QCOMPARE(coll.addMaterial(mat2), 1);
- QCOMPARE(coll.addMaterial(mat), 0);
- QVERIFY(coll.material(0) == mat);
- QVERIFY(coll.material(1) == mat2);
- QCOMPARE(coll.indexOf(QLatin1String("foo")), 0);
- QCOMPARE(coll.indexOf(QLatin1String("bar")), 1);
- QCOMPARE(coll.size(), 2);
-
- // Shouldn't be able to add to another collection yet.
- QGLMaterialCollection coll2;
- QCOMPARE(coll2.addMaterial(mat), -1);
- QVERIFY(coll2.isEmpty());
-
- // Remove a material from the first collection and add it to the second.
- QVERIFY(mat->parent() == &coll);
- coll.removeMaterial(mat);
- QVERIFY(!mat->parent()); // Parent should revert to null when removed.
- QCOMPARE(coll.size(), 2); // Still two elements, one is null.
- QVERIFY(coll.material(0) == 0);
- QVERIFY(coll.material(1) == mat2);
- QCOMPARE(coll.indexOf(QLatin1String("foo")), -1);
- QCOMPARE(coll.indexOf(QLatin1String("bar")), 1);
- QCOMPARE(coll2.addMaterial(mat), 0);
- QVERIFY(mat->parent() == &coll2);
- QCOMPARE(coll2.size(), 1);
- QVERIFY(coll2.material(0) == mat);
- QCOMPARE(coll2.indexOf(QLatin1String("foo")), 0);
-}
-
-// Test material marking.
-void tst_QGLMaterialCollection::markUsed()
-{
- QGLMaterialCollection coll;
-
- QGLMaterial *mat = new QGLMaterial(this);
- mat->setObjectName(QLatin1String("foo"));
- connect(mat, SIGNAL(destroyed()), this, SLOT(materialDestroyed()));
-
- QGLMaterial *mat2 = new QGLMaterial(this);
- mat2->setObjectName(QLatin1String("bar"));
- connect(mat2, SIGNAL(destroyed()), this, SLOT(materialDestroyed()));
-
- QGLMaterial *mat3 = new QGLMaterial(this);
- mat3->setObjectName(QLatin1String("baz"));
- connect(mat3, SIGNAL(destroyed()), this, SLOT(materialDestroyed()));
-
- coll.addMaterial(mat);
- coll.addMaterial(mat2);
- coll.addMaterial(mat3);
-
- QVERIFY(!coll.isMaterialUsed(0));
- QVERIFY(!coll.isMaterialUsed(1));
- QVERIFY(!coll.isMaterialUsed(2));
-
- coll.markMaterialAsUsed(1);
- QVERIFY(!coll.isMaterialUsed(0));
- QVERIFY(coll.isMaterialUsed(1));
- QVERIFY(!coll.isMaterialUsed(2));
-
- QVERIFY(coll.material(0) == mat);
- QVERIFY(coll.material(1) == mat2);
- QVERIFY(coll.material(2) == mat3);
-
- destroyCount = 0;
- coll.removeUnusedMaterials();
- QCOMPARE(destroyCount, 2);
-
- QVERIFY(coll.material(0) == 0);
- QVERIFY(coll.material(1) == mat2);
- QVERIFY(coll.material(2) == 0);
-
- QVERIFY(!coll.contains(QLatin1String("foo")));
- QVERIFY(coll.contains(QLatin1String("bar")));
- QVERIFY(!coll.contains(QLatin1String("baz")));
-
- // Bounds checks.
- QVERIFY(!coll.isMaterialUsed(-1));
- QVERIFY(!coll.isMaterialUsed(3));
-}
-
-QTEST_APPLESS_MAIN(tst_QGLMaterialCollection)
-
-#include "tst_qglmaterialcollection.moc"
diff --git a/tests/auto/threed/qglpainter/qglpainter.pro b/tests/auto/threed/qglpainter/qglpainter.pro
deleted file mode 100644
index 81d19f68..00000000
--- a/tests/auto/threed/qglpainter/qglpainter.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGET = tst_qglpainter
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-VPATH += ../../../shared
-
-SOURCES += tst_qglpainter.cpp \
- qgltestwidget.cpp \
- compareimage.cpp \
- qglsimulator.cpp
-HEADERS += qgltestwidget.h \
- compareimage.h \
- qglsimulator.h
-QT+=widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qglpainter/qglsimulator.cpp b/tests/auto/threed/qglpainter/qglsimulator.cpp
deleted file mode 100644
index 80cf4d60..00000000
--- a/tests/auto/threed/qglpainter/qglsimulator.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "qglsimulator.h"
-
-QGLSimulator::QGLSimulator(QPainter *painter, const QSize& size)
- : m_painter(painter),
- m_size(size),
- m_clearColor(Qt::black),
- m_viewport(0, 0, size.width(), size.height())
-{
-}
-
-QGLSimulator::~QGLSimulator()
-{
-}
-
-void QGLSimulator::clear()
-{
- m_painter->fillRect(0, 0, m_size.width(), m_size.height(), m_clearColor);
-}
-
-void QGLSimulator::setScissor(const QRect& rect)
-{
- m_scissor = rect;
- m_painter->setClipRect(rect);
-}
-
-void QGLSimulator::intersectScissor(const QRect& rect)
-{
- m_scissor = rect.intersected(m_scissor);
- m_painter->setClipRect(m_scissor);
-}
-
-void QGLSimulator::expandScissor(const QRect& rect)
-{
- m_scissor = rect.united(m_scissor);
- m_painter->setClipRect(m_scissor);
-}
-
-void QGLSimulator::clearScissor()
-{
- m_painter->setClipping(false);
-}
-
-void QGLSimulator::setViewport(int x, int y, int width, int height)
-{
- m_viewport = QRect(x, y, width, height);
-}
-
-// Set the flat color for drawing triangles.
-void QGLSimulator::setColor(const QColor& color)
-{
- m_painter->setBrush(QBrush(color));
- m_painter->setPen(QPen());
-}
-
-// Draw a set of triangles from a vertex array.
-void QGLSimulator::drawTriangles(const QVector2DArray& array)
-{
- QVector<QPointF> points;
-
- for (int index = 0; index < array.count(); ++index) {
- QVector3D v = array[index];
- points.append(project(v));
- }
-
- m_painter->drawPolygon(points);
-}
-
-void QGLSimulator::drawTriangles(const QVector3DArray& array)
-{
- QVector<QPointF> points;
-
- for (int index = 0; index < array.count(); ++index) {
- QVector3D v = array[index];
- points.append(project(v));
- }
-
- m_painter->drawPolygon(points);
-}
-
-// Project a 3D point to 2D and convert to left-handed QPainter co-ordinates.
-QPointF QGLSimulator::project(const QVector3D& vector) const
-{
- QVector3D pt = (m_projectionMatrix * m_modelViewMatrix) * vector;
- qreal x = (pt.x() + 1.0f) * m_viewport.width() * 0.5f + m_viewport.x();
- qreal y = (pt.y() + 1.0f) * m_viewport.height() * 0.5f + m_viewport.y();
- y = (m_viewport.height() - 1) - y;
- return QPointF(x, y);
-}
diff --git a/tests/auto/threed/qglpainter/qglsimulator.h b/tests/auto/threed/qglpainter/qglsimulator.h
deleted file mode 100644
index dc4a4439..00000000
--- a/tests/auto/threed/qglpainter/qglsimulator.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef QGLSIMULATOR_H
-#define QGLSIMULATOR_H
-
-#include <QtGui/qpainter.h>
-#include <QtGui/qcolor.h>
-#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qvector3d.h>
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-
-class QGLSimulator
-{
-public:
- QGLSimulator(QPainter *painter, const QSize& size);
- ~QGLSimulator();
-
- void setClearColor(const QColor& color) { m_clearColor = color; }
- void clear();
-
- void setScissor(const QRect& rect);
- void intersectScissor(const QRect& rect);
- void expandScissor(const QRect& rect);
- void clearScissor();
-
- void setViewport(int x, int y, int width, int height);
-
- QMatrix4x4 projectionMatrix() const { return m_projectionMatrix; }
- void setProjectionMatrix(const QMatrix4x4& m) { m_projectionMatrix = m; }
-
- QMatrix4x4 modelViewMatrix() const { return m_modelViewMatrix; }
- void setModelViewMatrix(const QMatrix4x4& m) { m_modelViewMatrix = m; }
-
- void setColor(const QColor& color);
-
- void drawTriangles(const QVector2DArray& array);
- void drawTriangles(const QVector3DArray& array);
-
-private:
- QPainter *m_painter;
- QSize m_size;
- QColor m_clearColor;
- QRect m_viewport;
- QMatrix4x4 m_projectionMatrix;
- QMatrix4x4 m_modelViewMatrix;
- QRect m_scissor;
-
- QPointF project(const QVector3D& vector) const;
-};
-
-#endif
diff --git a/tests/auto/threed/qglpainter/qgltestwidget.cpp b/tests/auto/threed/qglpainter/qgltestwidget.cpp
deleted file mode 100644
index 892d32a9..00000000
--- a/tests/auto/threed/qglpainter/qgltestwidget.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qgltestwidget.h"
-#include "compareimage.h"
-#include "qglframebufferobjectsurface.h"
-
-#include <QtCore/qeventloop.h>
-#include <QtCore/qtimer.h>
-#include <QtGui/qpainter.h>
-
-QGLTestWidget::QGLTestWidget(QWindow *parent)
- : QGLView(parent)
-{
- eventLoop = 0;
- paintDone = false;
- target = 0;
- method = 0;
-}
-
-QGLTestWidget::~QGLTestWidget()
-{
- delete eventLoop;
-}
-
-bool QGLTestWidget::runTest(QObject *target, const char *method, int timeout)
-{
- if (eventLoop)
- delete eventLoop;
- paintDone = false;
- capture = QImage();
- simulated = QImage();
- this->target = target;
- this->method = method;
- eventLoop = new QEventLoop(this);
- QTimer::singleShot(timeout, eventLoop, SLOT(quit()));
- if (!isVisible()) {
- show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(this);
-#endif
- } else {
- update();
- }
- if (!paintDone)
- eventLoop->exec();
- delete eventLoop;
- eventLoop = 0;
- this->target = 0;
- this->method = 0;
- if (!paintDone) {
- qWarning("timed out");
- return false;
- }
- if (!qFuzzyCompare(capture, simulated)) {
- qWarning("output is not as expected");
- return false;
- }
- return true;
-}
-
-void QGLTestWidget::paintGL()
-{
- if (target && method)
- QMetaObject::invokeMethod(target, method, Qt::DirectConnection);
- QOpenGLFramebufferObject fbo(512, 512);
- QGLFramebufferObjectSurface surf(&fbo);
-
- capture = fbo.toImage();
-
- if (target && method) {
- QSize sz = size();
- simulated = QImage(sz, QImage::Format_RGB32);
- QPainter painter;
- painter.begin(&simulated);
- QByteArray meth(method);
- meth.append('Q');
- QMetaObject::invokeMethod
- (target, meth.constData(), Qt::DirectConnection,
- Q_ARG(QPainter *, &painter), Q_ARG(const QSize, sz));
- painter.end();
- }
- if (!paintDone) {
- paintDone = true;
- if (eventLoop)
- eventLoop->quit();
- }
-}
diff --git a/tests/auto/threed/qglpainter/qgltestwidget.h b/tests/auto/threed/qglpainter/qgltestwidget.h
deleted file mode 100644
index 973e393f..00000000
--- a/tests/auto/threed/qglpainter/qgltestwidget.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef QGLTESTWIDGET_H
-#define QGLTESTWIDGET_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QEventLoop;
-QT_END_NAMESPACE
-
-class QGLTestWidget : public QGLView
-{
- Q_OBJECT
-public:
- QGLTestWidget(QWindow *parent = 0);
- ~QGLTestWidget();
-
- bool runTest(QObject *target, const char *method, int timeout = 5000);
-
- QImage actualOutput() const { return capture; }
- QImage simulatedOutput() const { return simulated; }
-
-protected:
- void paintGL();
-
-private:
- QEventLoop *eventLoop;
- bool paintDone;
- QImage capture;
- QImage simulated;
- QObject *target;
- const char *method;
-};
-
-#endif
diff --git a/tests/auto/threed/qglpainter/tst_qglpainter.cpp b/tests/auto/threed/qglpainter/tst_qglpainter.cpp
deleted file mode 100644
index dca50fb9..00000000
--- a/tests/auto/threed/qglpainter/tst_qglpainter.cpp
+++ /dev/null
@@ -1,917 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtGui/qpainter.h>
-#include <QtGui/QOpenGLContext>
-
-#include "qgltestwidget.h"
-#include "qglpainter.h"
-#include "qglsimulator.h"
-
-class tst_QGLPainter : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLPainter() : widget(0) {}
- ~tst_QGLPainter() {}
-
-private slots:
- void initTestCase();
- void cleanupTestCase();
- void clear();
- void drawTriangle();
- void scissor();
- void userMatrixStack();
- void projectionMatrixStack();
- void modelViewMatrixStack();
- void worldMatrix();
- void basicCullable();
- void isCullable_data();
- void isCullable();
- void isCullableVert_data();
- void isCullableVert();
- void lights();
- void nextPowerOfTwo_data();
- void nextPowerOfTwo();
-
-public slots:
- void clearPaint();
- void clearPaintQ(QPainter *painter, const QSize& size);
- void drawTrianglePaint();
- void drawTrianglePaintQ(QPainter *painter, const QSize& size);
- void scissorPaint();
- void scissorPaintQ(QPainter *painter, const QSize& size);
-
-private:
- QGLTestWidget *widget;
-};
-
-void tst_QGLPainter::initTestCase()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- widget = new QGLTestWidget();
-}
-
-void tst_QGLPainter::cleanupTestCase()
-{
- delete widget;
-}
-
-void tst_QGLPainter::clear()
-{
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QVERIFY(widget->runTest(this, "clearPaint"));
-}
-
-void tst_QGLPainter::clearPaint()
-{
- QGLPainter painter;
- painter.begin();
- painter.setClearColor(Qt::blue);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-}
-
-void tst_QGLPainter::clearPaintQ(QPainter *painter, const QSize& size)
-{
- QGLSimulator sim(painter, size);
- sim.setClearColor(Qt::blue);
- sim.clear();
-}
-
-void tst_QGLPainter::drawTriangle()
-{
- QSKIP("Fails under qt5");
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QVERIFY(widget->runTest(this, "drawTrianglePaint"));
-}
-
-void tst_QGLPainter::drawTrianglePaint()
-{
- QGLPainter painter;
- painter.begin();
- painter.setClearColor(Qt::black);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- QMatrix4x4 projm;
- projm.ortho(widget->geometry());
- painter.projectionMatrix() = projm;
- painter.modelViewMatrix().setToIdentity();
-
- QVector2DArray vertices;
- vertices.append(10, 100);
- vertices.append(500, 100);
- vertices.append(500, 500);
-
- painter.clearAttributes();
- painter.setStandardEffect(QGL::FlatColor);
- painter.setColor(Qt::green);
- painter.setVertexAttribute(QGL::Position, vertices);
- painter.draw(QGL::Triangles, 3);
-}
-
-void tst_QGLPainter::drawTrianglePaintQ(QPainter *painter, const QSize& size)
-{
- QGLSimulator sim(painter, size);
-
- sim.clear();
- sim.setColor(Qt::green);
-
- QMatrix4x4 proj;
- proj.ortho(widget->geometry());
- sim.setProjectionMatrix(proj);
-
- QVector2DArray vertices;
- vertices.append(10, 100);
- vertices.append(500, 100);
- vertices.append(500, 500);
-
- sim.drawTriangles(vertices);
-}
-
-static QRect fetchGLScissor(const QRect& windowRect)
-{
- GLint scissor[4];
- glGetIntegerv(GL_SCISSOR_BOX, scissor);
- if (scissor[2] != 0 && scissor[3] != 0) {
- return QRect(scissor[0],
- windowRect.height() - (scissor[1] + scissor[3]),
- scissor[2], scissor[3]);
- } else {
- // Normally should be (0, 0, 0, 0) - don't adjust for window height.
- return QRect(scissor[0], scissor[1], scissor[2], scissor[3]);
- }
-}
-
-void tst_QGLPainter::scissor()
-{
- QSKIP("Does not pass on Qt5");
-
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- // Run a painting test to check that the scissor works.
- QVERIFY(widget->runTest(this, "scissorPaint"));
-
- // Perform some lower level tests to ensure that the
- // GL state is updated properly as the scissor changes.
- QGLPainter painter;
- painter.begin(widget);
- QRect windowRect = widget->geometry();
-
- QVERIFY(!glIsEnabled(GL_SCISSOR_TEST));
-
- painter.setScissor(windowRect);
- QCOMPARE(fetchGLScissor(windowRect), windowRect);
-
- QRect subRect(windowRect.width() / 3,
- windowRect.height() / 3,
- 2 * windowRect.width() / 3,
- 2 * windowRect.height() / 3);
- painter.setScissor(subRect);
- QCOMPARE(fetchGLScissor(windowRect), subRect);
-
- // Empty rectangles should result in glScissor(0, 0, 0, 0).
- painter.setScissor(QRect(0, 0, -2, -2));
- QCOMPARE(fetchGLScissor(windowRect), QRect(0, 0, 0, 0));
- painter.setScissor(QRect(27, 42, 0, 0));
- QCOMPARE(fetchGLScissor(windowRect), QRect(0, 0, 0, 0));
-}
-
-void tst_QGLPainter::scissorPaint()
-{
- QGLPainter painter;
- painter.begin();
- painter.setClearColor(Qt::black);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- QMatrix4x4 projm;
- projm.ortho(widget->geometry());
- painter.projectionMatrix() = projm;
- painter.modelViewMatrix().setToIdentity();
-
- QVector2DArray vertices;
- vertices.append(10, 100);
- vertices.append(500, 100);
- vertices.append(500, 500);
-
- // Paint a green triangle.
- painter.clearAttributes();
- painter.setStandardEffect(QGL::FlatColor);
- painter.setColor(Qt::green);
- painter.setVertexAttribute(QGL::Position, vertices);
- painter.draw(QGL::Triangles, 3);
-
- // Change the top part of the triangle to blue.
- QRect scissor(0, 0, widget->width(), qMin(widget->height() / 2, 200));
- painter.setScissor(scissor);
- glEnable(GL_SCISSOR_TEST);
- painter.setColor(Qt::blue);
- painter.draw(QGL::Triangles, 3);
-
- // Intersect and draw red over the blue section.
- painter.setScissor(scissor.intersected
- (QRect(0, 0, widget->width(), qMin(widget->height() / 4, 150))));
- painter.setColor(Qt::red);
- painter.draw(QGL::Triangles, 3);
-
- // Change the bottom part of the triangle to yellow.
- int y = qMin(widget->height() / 2, 350);
- scissor = QRect(0, y, 400, widget->height() - y);
- painter.setScissor(scissor);
- painter.setColor(Qt::yellow);
- painter.draw(QGL::Triangles, 3);
-
- // Intersect and expand, to extend the yellow region.
- scissor &= QRect(0, y + 20, 400, widget->height() - y - 20);
- scissor |= QRect(0, y + 20, 450, widget->height() - y - 20);
- painter.setScissor(scissor);
- painter.setColor(Qt::yellow);
- painter.draw(QGL::Triangles, 3);
-
- glDisable(GL_SCISSOR_TEST);
-}
-
-void tst_QGLPainter::scissorPaintQ(QPainter *painter, const QSize& size)
-{
- QGLSimulator sim(painter, size);
-
- sim.clear();
-
- QMatrix4x4 proj;
- proj.ortho(widget->geometry());
- sim.setProjectionMatrix(proj);
-
- QVector2DArray vertices;
- vertices.append(10, 100);
- vertices.append(500, 100);
- vertices.append(500, 500);
-
- // Paint a green triangle.
- sim.setColor(Qt::green);
- sim.drawTriangles(vertices);
-
- // Change the top part of the triangle to blue.
- sim.setScissor
- (QRect(0, 0, widget->width(), qMin(widget->height() / 2, 200)));
- sim.setColor(Qt::blue);
- sim.drawTriangles(vertices);
-
- // Intersect and draw red over the blue section.
- sim.intersectScissor
- (QRect(0, 0, widget->width(), qMin(widget->height() / 4, 150)));
- sim.setColor(Qt::red);
- sim.drawTriangles(vertices);
-
- // Change the bottom part of the triangle to yellow.
- int y = qMin(widget->height() / 2, 350);
- sim.setScissor
- (QRect(0, y, 400, widget->height() - y));
- sim.setColor(Qt::yellow);
- sim.drawTriangles(vertices);
-
- // Intersect and expand, to extend the yellow region.
- sim.intersectScissor
- (QRect(0, y + 20, 400, widget->height() - y - 20));
- sim.expandScissor
- (QRect(0, y + 20, 450, widget->height() - y - 20));
- sim.setColor(Qt::yellow);
- sim.drawTriangles(vertices);
-}
-
-// Test the mathematical correctness of matrix stacks on a user stack.
-// We assume that QMatrix4x4 works and we can use it as an oracle.
-void tst_QGLPainter::userMatrixStack()
-{
- QMatrix4x4Stack stack;
-
- QVERIFY(stack.top().isIdentity());
- QVERIFY(QMatrix4x4(stack).isIdentity());
-
- QMatrix4x4 m;
- m.translate(1, 2, 3);
- m.scale(4, 5, 6);
- m.rotate(90, 0, 1, 0);
-
- stack.translate(1, 2, 3);
- stack.scale(4, 5, 6);
- stack.rotate(90, 0, 1, 0);
- QVERIFY(qFuzzyCompare(m, stack.top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(stack)));
-
- stack.push();
- QVERIFY(qFuzzyCompare(m, stack.top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(stack)));
-
- stack.setToIdentity();
- QVERIFY(stack.top().isIdentity());
-
- stack.translate(QVector3D(1, 2, 3));
- stack.scale(QVector3D(4, 5, 6));
- stack.rotate(90, QVector3D(0, 1, 0));
- QVERIFY(qFuzzyCompare(m, stack.top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(stack)));
-
- QMatrix4x4 m2(m);
- m2.scale(-3);
-
- stack.scale(-3);
- QVERIFY(qFuzzyCompare(m2, stack.top()));
- QVERIFY(qFuzzyCompare(m2, QMatrix4x4(stack)));
-
- stack.pop();
-
- QVERIFY(qFuzzyCompare(m, stack.top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(stack)));
-
- stack.pop(); // at bottom of stack - no change
-
- QVERIFY(qFuzzyCompare(m, stack.top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(stack)));
-
- stack = m2;
- QVERIFY(qFuzzyCompare(m2, stack.top()));
- QVERIFY(qFuzzyCompare(m2, QMatrix4x4(stack)));
-
- QMatrix4x4 m3 = m2 * m;
- stack *= m;
- QVERIFY(qFuzzyCompare(m3, stack.top()));
- QVERIFY(qFuzzyCompare(m3, QMatrix4x4(stack)));
-
- m3.rotate(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), -90));
- stack.rotate(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), -90));
-
- QVERIFY(qFuzzyCompare(m3, stack.top()));
- QVERIFY(qFuzzyCompare(m3, QMatrix4x4(stack)));
-
- QMatrix4x4 m4;
-
- m4.setToIdentity();
- m4.ortho(QRect(2, 3, 4, 5));
- stack.setToIdentity();
- QMatrix4x4 projm;
- projm.ortho(QRect(2, 3, 4, 5));
- stack = projm;
- QVERIFY(qFuzzyCompare(m4, stack.top()));
- QVERIFY(qFuzzyCompare(m4, QMatrix4x4(stack)));
-}
-
-#if defined(QT_OPENGL_ES_2)
-#define QGL_NO_MATRIX_FETCH 1
-#endif
-
-#ifndef QGL_NO_MATRIX_FETCH
-
-static void clearGLMatrix(GLenum type)
-{
- glMatrixMode(type);
- glLoadIdentity();
-}
-
-static bool checkGLMatrix(GLenum type, const QMatrix4x4& expected)
-{
- QMatrix4x4 actual;
- int index;
- GLfloat mat[16];
- glGetFloatv(type, mat);
- qreal *m = actual.data();
- for (index = 0; index < 16; ++index)
- m[index] = mat[index];
- for (index = 0; index < 16; ++index) {
- // Introduce some fuzziness for GL servers that
- // use a different precision from QMatrix4x4.
- if (qAbs(actual.constData()[index] - expected.constData()[index])
- >= 0.001)
- return false;
- }
- return true;
-}
-
-#else
-
-#ifndef GL_PROJECTION
-#define GL_PROJECTION 0
-#endif
-#ifndef GL_PROJECTION_MATRIX
-#define GL_PROJECTION_MATRIX 0
-#endif
-#ifndef GL_MODELVIEW
-#define GL_MODELVIEW 0
-#endif
-#ifndef GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW_MATRIX 0
-#endif
-
-// OpenGL/ES 2.0 does not have server-side matrices.
-// For such platforms, we stub out the checks and just hope that they work.
-static void clearGLMatrix(GLenum) {}
-static bool checkGLMatrix(GLenum, const QMatrix4x4&) { return true; }
-
-#endif
-
-void tst_QGLPainter::projectionMatrixStack()
-{
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter painter(widget);
-
- painter.projectionMatrix().setToIdentity();
- QVERIFY(painter.projectionMatrix().top().isIdentity());
- QVERIFY(QMatrix4x4(painter.projectionMatrix()).isIdentity());
-
- // Clear the matrix in the GL server.
- clearGLMatrix(GL_PROJECTION);
-
- QMatrix4x4 m;
- m.ortho(2, 4, 3, 1, 10, 50);
- painter.projectionMatrix() = m;
- QVERIFY(qFuzzyCompare(m, painter.projectionMatrix().top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(painter.projectionMatrix())));
-
- // The matrix in the GL server should still be the identity.
- QVERIFY(checkGLMatrix(GL_PROJECTION_MATRIX, QMatrix4x4()));
-
- // Force an update to the GL server.
- painter.updateFixedFunction(QGLPainter::UpdateProjectionMatrix);
-
- // Check that the server received the value we set.
- QVERIFY(checkGLMatrix(GL_PROJECTION_MATRIX, m));
-}
-
-void tst_QGLPainter::modelViewMatrixStack()
-{
- if (!widget->context()->isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter painter(widget);
-
- painter.modelViewMatrix().setToIdentity();
- QVERIFY(painter.modelViewMatrix().top().isIdentity());
- QVERIFY(QMatrix4x4(painter.modelViewMatrix()).isIdentity());
-
- // Clear the matrix in the GL server.
- clearGLMatrix(GL_MODELVIEW);
-
- QMatrix4x4 m;
- m.translate(1, 2, 3);
- m.scale(4, 5, 6);
- m.rotate(90, 0, 1, 0);
- painter.modelViewMatrix().translate(1, 2, 3);
- painter.modelViewMatrix().scale(4, 5, 6);
- painter.modelViewMatrix().rotate(90, 0, 1, 0);
- QVERIFY(qFuzzyCompare(m, painter.modelViewMatrix().top()));
- QVERIFY(qFuzzyCompare(m, QMatrix4x4(painter.modelViewMatrix())));
-
- // The matrix in the GL server should still be the identity.
- QVERIFY(checkGLMatrix(GL_MODELVIEW_MATRIX, QMatrix4x4()));
-
- // Force an update to the GL server.
- painter.updateFixedFunction(QGLPainter::UpdateModelViewMatrix);
-
- // Check that the server received the value we set.
- QVERIFY(checkGLMatrix(GL_MODELVIEW_MATRIX, m));
-}
-
-static bool fuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2)
-{
- for (int row = 0; row < 4; ++row) {
- for (int col = 0; col < 4; ++col) {
- if (qAbs(m1(row, col) - m2(row, col)) >= 0.00001f)
- return false;
- }
- }
- return true;
-}
-
-void tst_QGLPainter::worldMatrix()
-{
- QGLPainter painter(widget);
-
- QGLCamera camera;
- camera.setEye(QVector3D(1, 2, 10));
- camera.setCenter(QVector3D(20, 3, -4));
- camera.setUpVector(QVector3D(1, 1, 1));
- painter.setCamera(&camera);
-
- // The modelview matrix should be the eye look-at component.
- QMatrix4x4 mv;
- mv.lookAt(camera.eye(), camera.center(), camera.upVector());
- QVERIFY(fuzzyCompare(painter.modelViewMatrix(), mv));
-
- // The world matrix should currently be the identity.
- QVERIFY(fuzzyCompare(painter.worldMatrix(), QMatrix4x4()));
-
- // Change the modelview.
- painter.modelViewMatrix().translate(0.0f, 5.0f, 0.0f);
- painter.modelViewMatrix().scale(1.5f);
-
- // Check the modelview and world matrices against their expected values.
- QMatrix4x4 world;
- world.translate(0.0f, 5.0f, 0.0f);
- world.scale(1.5f);
- QVERIFY(fuzzyCompare(painter.modelViewMatrix(), mv * world));
- QVERIFY(fuzzyCompare(painter.worldMatrix(), world));
-}
-
-static void ensureContext(QWindow &win, QOpenGLContext &ctx)
-{
- QSurfaceFormat format;
- format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
- ctx.setFormat(format);
-#ifndef QT_NO_DEBUG_STREAM
- QSurfaceFormat oldFormat = format;
-#endif
- ctx.create();
- // TODO: is it possible that the platform will downgrade the actual
- // format, or will it just fail if it can't deliver the actual format
- format = ctx.format();
-#ifndef QT_NO_DEBUG_STREAM
- if (oldFormat.swapBehavior() != format.swapBehavior())
- qWarning() << "Could not create context for swap behavior"
- << oldFormat.swapBehavior();
-#endif
- ctx.makeCurrent(&win);
-}
-
-void tst_QGLPainter::basicCullable()
-{
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter painter(&glw);
- painter.modelViewMatrix().setToIdentity();
-
- // Default values for the camera have
- // eye = (0, 0, 10) - so eye at positive 10 on z-axis
- // center = (0, 0, 0) - looking at the origin, in a negative z-direction
- // viewport = 2 x 2 - ideal square view frustum
- // near = 5 - distance from eye to near plane
- // far = 1000 - distance from eye to far plane
- // far plane is a z = -990
- QGLCamera camera;
- painter.setCamera(&camera);
-
- // origin itself and a point 10 further down the view vector
- // both must be visible
- QVERIFY(!painter.isCullable(QVector3D(0, 0, 0)));
- QVERIFY(!painter.isCullable(QVector3D(0, 0, -10)));
-
- // the position of the eye itself, is behind the near plane, so culled.
- QVERIFY(painter.isCullable(QVector3D(0, 0, 10)));
- // Reset the camera and then check boxes in front of the camera
- // that are close to the near and far planes and the eye.
- QGLCamera camera2;
- painter.setCamera(&camera2);
-
- // Box around the eye, but in front of the near plane.
- QBox3D box2(QVector3D(-1, -1, 11), QVector3D(1, 1, 9));
- QVERIFY(painter.isCullable(box2));
-
- // Box that surrounds the near plane.
- QBox3D box3(QVector3D(-1, -1, 6), QVector3D(1, 1, 4));
- QVERIFY(!painter.isCullable(box3));
-
- // Box between the near plane and the eye.
- QBox3D box4(QVector3D(-1, -1, 7), QVector3D(1, 1, 6));
- QVERIFY(painter.isCullable(box4));
-
- // Box extending from behind the eye to inside the viewing cube.
- // Not cullable because it is partially visible.
- QBox3D box5(QVector3D(-1, -1, 11), QVector3D(1, 1, 0));
- QVERIFY(!painter.isCullable(box5));
-
- // Box that surrounds the far plane.
- QBox3D box6(QVector3D(-1, -1, -989), QVector3D(1, 1, -991));
- QVERIFY(!painter.isCullable(box6));
-
- // Box that is between the near and far planes, but close to far plane.
- QBox3D box7(QVector3D(-1, -1, -988), QVector3D(1, 1, -989));
- QVERIFY(!painter.isCullable(box7));
-
- // Box that is beyond the far plane.
- QBox3D box8(QVector3D(-1, -1, -1000), QVector3D(1, 1, -1001));
- QVERIFY(painter.isCullable(box8));
-}
-
-static void setupTestCamera(QGLCamera &camera, float distance)
-{
- // These values are based on the special camera as per the images in
- // doc/src/images/view-frustum*
-
- // Check the cullability of a box at 10 degree increments of rotation.
- // It should be visible between -20 and 20 degrees but otherwise not.
- // Also check the center point of the box.
-
- camera.setNearPlane(2.2f);
- camera.setFarPlane(14.0f);
-
- // This value comes from the ratio of the far plane size 8 x 8 to the
- // far plane distance, multiplied by the near plane, to give the near
- // plane size: 2.2 x (4 / 14) = 1.257
- camera.setViewSize(QSizeF(1.257f, 1.257f));
-
- // as shown in the images, we use a camera at -z instead of the default +z
- // but the center remains the same at 0, 0, 0
- camera.setEye(QVector3D(0, 0, distance));
-
- // if the distance would push the camera eye past the view center
- // move the view center away
- if (distance > 0.0f)
- camera.setCenter(QVector3D(0.0f, 0.0f, distance + 2));
-}
-
-void tst_QGLPainter::isCullable_data()
-{
- QTest::addColumn<float>("angle");
- QTest::addColumn<float>("distance");
- QTest::addColumn<bool>("culled");
- QTest::addColumn<bool>("center_culled");
-
- // Check the cullability of a box at 10 degree increments of rotation.
- // It should be visible between -20 and 20 degrees but otherwise not.
- // Also check the point at the center of the box.
-
- QTest::newRow("culled-neg40") << -40.0f << -8.0f << true << true;
- QTest::newRow("culled-neg30") << -30.0f << -8.0f << true << true;
- QTest::newRow("part-vis-neg20") << -20.0f << -8.0f << false << false;
- QTest::newRow("part-vis-neg10") << -10.0f << -8.0f << false << false;
- QTest::newRow("all-vis-00") << 0.0f << -8.0f << false << false;
- QTest::newRow("part-vis-pos10") << 10.0f << -8.0f << false << false;
- QTest::newRow("part-vis-pos20") << 20.0f << -8.0f << false << false;
- QTest::newRow("culled-pos30") << 30.0f << -8.0f << true << true;
- QTest::newRow("culled-pos40") << 40.0f << -8.0f << true << true;
-
- // Check when the eye is at varying distances from the box, with
- // (in one case with an angle for good measure) so that it needs
- // testing against the near and far planes.
-
- QTest::newRow("culled-eye-z+2") << 0.0f << 2.0f << true << true;
- QTest::newRow("culled-eye-z+0") << 0.0f << 0.0f << true << true;
- QTest::newRow("part-vis-eye-z-2-around-np") << 0.0f << -2.0f << false << true;
- QTest::newRow("part-vis-eye-z-3-around-np") << 0.0f << -3.0f << false << false;
- QTest::newRow("part-vis-eye-z-4-close-np") << 0.0f << -4.0f << false << false;
- QTest::newRow("part-vis-eye-z-14.5") << 0.0f << -14.5f << false << true;
- QTest::newRow("part-vis-eye-z-14-angle-20") << 20.0f << -14.0f << false << false;
- QTest::newRow("culled-eye-z-20") << 0.0f << -20.0f << true << true;
-}
-
-void tst_QGLPainter::isCullable()
-{
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter painter(&glw);
- painter.modelViewMatrix().setToIdentity();
-
- QGLCamera camera;
-
- QFETCH(float, angle);
- QFETCH(float, distance);
- QFETCH(bool, culled);
- QFETCH(bool, center_culled);
-
- setupTestCamera(camera, distance);
- if (angle != 0.0f)
- camera.rotateEye(camera.pan(angle));
-
- painter.setCamera(&camera);
-
- QBox3D box(QVector3D(-1, -1, -1), QVector3D(1, 1, 1));
- QCOMPARE(painter.isCullable(box), culled);
- QCOMPARE(painter.isCullable(box.center()), center_culled);
-}
-
-void tst_QGLPainter::isCullableVert_data()
-{
- QTest::addColumn<float>("angle");
- QTest::addColumn<float>("distance");
- QTest::addColumn<bool>("culled");
- QTest::addColumn<bool>("center_culled");
-
- // Check the cullability of a box at 10 degree increments of rotation.
- // It should be visible between -20 and 20 degrees but otherwise not.
- // Also check the point at the center of the box.
-
- QTest::newRow("culled-neg40") << -40.0f << -8.0f << true << true;
- QTest::newRow("culled-neg30") << -30.0f << -8.0f << true << true;
- QTest::newRow("part-vis-neg20") << -20.0f << -8.0f << false << true;
- QTest::newRow("part-vis-neg10") << -10.0f << -8.0f << false << false;
- QTest::newRow("all-vis-00") << 0.0f << -8.0f << false << false;
- QTest::newRow("part-vis-pos10") << 10.0f << -8.0f << false << false;
- QTest::newRow("part-vis-pos20") << 20.0f << -8.0f << false << true;
- QTest::newRow("culled-pos30") << 30.0f << -8.0f << true << true;
- QTest::newRow("culled-pos40") << 40.0f << -8.0f << true << true;
-
- QTest::newRow("culled-eye-z+2") << 0.0f << 2.0f << true << true;
- QTest::newRow("culled-eye-z+0") << 0.0f << 0.0f << true << true;
- QTest::newRow("part-vis-eye-z-2-around-np") << 0.0f << -2.0f << false << true;
- QTest::newRow("part-vis-eye-z-3-around-np") << 0.0f << -3.0f << false << false;
- QTest::newRow("part-vis-eye-z-4-close-np") << 0.0f << -4.0f << false << false;
- QTest::newRow("part-vis-eye-z-14.2") << 0.0f << -14.2f << false << true;
- QTest::newRow("part-vis-eye-z-14-angle-20") << 20.0f << -14.0f << false << true;
- QTest::newRow("culled-eye-z-20") << 0.0f << -20.0f << true << true;
-}
-
-void tst_QGLPainter::isCullableVert()
-{
- //QSKIP("isCullableVert not passing currently");
- // same test as isCullable, except we tilt the camera forward
- // and back instead of rotating it from side to side
- // since the view frustum is typically not square in section
- // as it depends on the surface, this will give different results.
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter painter(&glw);
- painter.modelViewMatrix().setToIdentity();
-
- QGLCamera camera;
-
- QFETCH(float, angle);
- QFETCH(float, distance);
- QFETCH(bool, culled);
- QFETCH(bool, center_culled);
-
- setupTestCamera(camera, distance);
- if (angle != 0.0f)
- camera.rotateEye(camera.tilt(angle));
-
- painter.setCamera(&camera);
-
- QBox3D box(QVector3D(-1, -1, -1), QVector3D(1, 1, 1));
- QCOMPARE(painter.isCullable(box), culled);
- QCOMPARE(painter.isCullable(box.center()), center_culled);
-}
-
-void tst_QGLPainter::lights()
-{
- QGLPainter painter(widget);
-
- // Make sure the mainLight() is not present before we start these tests.
- painter.removeLight(0);
-
- QCOMPARE(painter.maximumLightId(), -1);
- QVERIFY(painter.light(0) == 0);
- QVERIFY(painter.lightTransform(0).isIdentity());
- QVERIFY(painter.light(-1) == 0);
- QVERIFY(painter.lightTransform(-1).isIdentity());
-
- QGLLightParameters lparams1;
- QGLLightParameters lparams2;
- QGLLightParameters lparams3;
-
- int lightId1 = painter.addLight(&lparams1);
- QCOMPARE(lightId1, 0);
- QCOMPARE(painter.maximumLightId(), 0);
- QVERIFY(painter.light(lightId1) == &lparams1);
- QVERIFY(painter.lightTransform(lightId1) == painter.modelViewMatrix());
-
- QMatrix4x4 m(painter.modelViewMatrix());
- m.translate(-1, 2, -5);
-
- int lightId2 = painter.addLight(&lparams2, m);
- QCOMPARE(lightId2, 1);
- QCOMPARE(painter.maximumLightId(), 1);
- QVERIFY(painter.light(lightId1) == &lparams1);
- QVERIFY(painter.lightTransform(lightId1) == painter.modelViewMatrix());
- QVERIFY(painter.light(lightId2) == &lparams2);
- QVERIFY(painter.lightTransform(lightId2) == m);
-
- painter.removeLight(lightId1);
- QCOMPARE(painter.maximumLightId(), 1);
- QVERIFY(painter.light(lightId1) == 0);
- QVERIFY(painter.lightTransform(lightId1).isIdentity());
- QVERIFY(painter.light(lightId2) == &lparams2);
- QVERIFY(painter.lightTransform(lightId2) == m);
-
- int lightId3 = painter.addLight(&lparams3);
- QCOMPARE(lightId3, 0);
- QCOMPARE(painter.maximumLightId(), 1);
- QVERIFY(painter.light(lightId3) == &lparams3);
- QVERIFY(painter.lightTransform(lightId3) == painter.modelViewMatrix());
- QVERIFY(painter.light(lightId2) == &lparams2);
- QVERIFY(painter.lightTransform(lightId2) == m);
-
- painter.removeLight(lightId2);
- QCOMPARE(painter.maximumLightId(), 0);
- QVERIFY(painter.light(lightId3) == &lparams3);
- QVERIFY(painter.lightTransform(lightId3) == painter.modelViewMatrix());
- QVERIFY(painter.light(lightId2) == 0);
- QVERIFY(painter.lightTransform(lightId2).isIdentity());
-
- painter.removeLight(lightId3);
- QCOMPARE(painter.maximumLightId(), -1);
- QVERIFY(painter.light(lightId3) == 0);
- QVERIFY(painter.lightTransform(lightId3).isIdentity());
- QVERIFY(painter.light(lightId2) == 0);
- QVERIFY(painter.lightTransform(lightId2).isIdentity());
-
- // Check default construction of the main light.
- const QGLLightParameters *mainLight = painter.mainLight();
- QVERIFY(mainLight != 0);
- QCOMPARE(painter.maximumLightId(), 0);
- QVERIFY(painter.light(0) == mainLight);
- QVERIFY(painter.lightTransform(0).isIdentity());
-}
-
-void tst_QGLPainter::nextPowerOfTwo_data()
-{
- QTest::addColumn<int>("value");
- QTest::addColumn<int>("result");
-
- QTest::newRow("0") << 0 << 0;
- QTest::newRow("1") << 1 << 1;
- QTest::newRow("2") << 2 << 2;
- QTest::newRow("3") << 3 << 4;
- QTest::newRow("4") << 4 << 4;
- QTest::newRow("5") << 5 << 8;
- QTest::newRow("6") << 6 << 8;
- QTest::newRow("7") << 7 << 8;
- QTest::newRow("13") << 13 << 16;
- QTest::newRow("16") << 16 << 16;
- QTest::newRow("23") << 23 << 32;
- QTest::newRow("32") << 32 << 32;
- QTest::newRow("63") << 63 << 64;
- QTest::newRow("64") << 64 << 64;
- QTest::newRow("65") << 65 << 128;
- QTest::newRow("120") << 120 << 128;
- QTest::newRow("128") << 128 << 128;
- QTest::newRow("129") << 129 << 256;
-
- for (int bit = 8; bit <= 30; ++bit) {
- int value = (1 << bit);
- QByteArray str;
- str = QByteArray::number(value);
- QTest::newRow(str.constData()) << (value - 23) << value;
- QTest::newRow(str.constData()) << value << value;
- }
-}
-
-void tst_QGLPainter::nextPowerOfTwo()
-{
- QFETCH(int, value);
- QFETCH(int, result);
-
- QCOMPARE(QGL::nextPowerOfTwo(value), result);
- QCOMPARE(QGL::nextPowerOfTwo(QSize(value, 0)), QSize(result, 0));
- QCOMPARE(QGL::nextPowerOfTwo(QSize(0, value)), QSize(0, result));
-}
-
-QTEST_MAIN(tst_QGLPainter)
-
-#include "tst_qglpainter.moc"
diff --git a/tests/auto/threed/qglpickcolors/qglpickcolors.pro b/tests/auto/threed/qglpickcolors/qglpickcolors.pro
deleted file mode 100644
index ab665990..00000000
--- a/tests/auto/threed/qglpickcolors/qglpickcolors.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TARGET = tst_qglpickcolors
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../src/threed/painting
-VPATH += ../../../../src/threed/painting
-
-SOURCES += \
- tst_qglpickcolors.cpp \
- qglpickcolors.cpp
-
-HEADERS += \
- qglpickcolors_p.h
diff --git a/tests/auto/threed/qglpickcolors/tst_qglpickcolors.cpp b/tests/auto/threed/qglpickcolors/tst_qglpickcolors.cpp
deleted file mode 100644
index 795cf8fe..00000000
--- a/tests/auto/threed/qglpickcolors/tst_qglpickcolors.cpp
+++ /dev/null
@@ -1,299 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtCore/qset.h>
-#include "qglpickcolors_p.h"
-
-class tst_QGLPickColors : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLPickColors() {}
- ~tst_QGLPickColors() {}
-
-private slots:
- void distinctColors();
- void colorSpread();
-
- // Round-trip tests check various kinds of ways in which GPU's
- // may take the incoming RGB888 value for the pick color and turn
- // it into a value in the framebuffer, and then convert that
- // back into an RGB888 value later.
- //
- // For example, converting RGB888 -> RGB565 -> RGB888 will lose some
- // precision. The amount of lost precision will depend upon the
- // specific way in which the GPU does the conversion. The function
- // qt_qgl_normalize_pick_color() corrects for this and must always
- // return to the same value irrespective of how the GPU works.
- void roundTripExact();
- void roundTripTrunc565();
- void roundTripScale565();
- void roundTripDup565();
- void roundTripTrunc555();
- void roundTripScale555();
- void roundTripDup555();
- void roundTripScale444(); // Trunc doesn't work well with 444.
- void roundTripDup444();
-};
-
-// Check that all pick colors are distinct, opaque, and not black.
-void tst_QGLPickColors::distinctColors()
-{
- QSet<QRgb> used;
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index)) != 0) {
- QVERIFY(!used.contains(rgb));
- used += rgb;
- QVERIFY(qAlpha(rgb) == 255); // Opaque.
- QVERIFY(qRed(rgb) || qGreen(rgb) || qBlue(rgb)); // Not black.
- ++index;
- }
- QCOMPARE(rgb, QRgb(0));
- QCOMPARE(qt_qgl_pick_color(-1), QRgb(0));
- QVERIFY(index >= 1024);
-}
-
-// Check that the colors are well spread out so that accidental
-// mismatches will not occur.
-void tst_QGLPickColors::colorSpread()
-{
- int index1 = 0;
- int index2;
- QRgb rgb1, rgb2;
- while ((rgb1 = qt_qgl_pick_color(index1)) != 0) {
- index2 = qMax(index1 - 50, 0);
- while (index2 < index1) {
- rgb2 = qt_qgl_pick_color(index2);
- int rdiff = qRed(rgb1) - qRed(rgb2);
- int gdiff = qGreen(rgb1) - qGreen(rgb2);
- int bdiff = qBlue(rgb1) - qBlue(rgb2);
- int dist = rdiff * rdiff + gdiff * gdiff + bdiff * bdiff;
- if (dist < 15 * 15) { // FIXME: need more distance.
- qDebug() << index1 << index2 << dist
- << QString::number(rgb1, 16)
- << QString::number(rgb2, 16);
- }
- QVERIFY(dist >= 15 * 15);
- ++index2;
- }
- ++index1;
- }
-}
-
-// Check that round-tripping a color via exact representation works.
-void tst_QGLPickColors::roundTripExact()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0)
- QVERIFY(qt_qgl_normalize_pick_color(rgb) == rgb);
-}
-
-// Check round-tripping when RGB888 -> RGB565 uses truncation.
-void tst_QGLPickColors::roundTripTrunc565()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- QRgb truncrgb = qRgb(qRed(rgb) & 0xF8,
- qGreen(rgb) & 0xFC,
- qBlue(rgb) & 0xF8);
-
- QVERIFY(qt_qgl_normalize_pick_color(truncrgb) == rgb);
- }
-}
-
-// Check round-tripping when RGB888 -> RGB565 scales with floating point.
-void tst_QGLPickColors::roundTripScale565()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = int(qRed(rgb) * 31.0f / 255.0f);
- g = int(qGreen(rgb) * 63.0f / 255.0f);
- b = int(qBlue(rgb) * 31.0f / 255.0f);
-
- QRgb scalergb = qRgb(r * 255.0f / 31.0f,
- g * 255.0f / 63.0f,
- b * 255.0f / 31.0f);
-
- QVERIFY(qt_qgl_normalize_pick_color(scalergb) == rgb);
-
- // Scale up, but duplicate down.
- QRgb duprgb = qRgb((r << 3) | (r >> 2),
- (g << 2) | (g >> 4),
- (b << 3) | (b >> 2));
-
- QVERIFY(qt_qgl_normalize_pick_color(duprgb) == rgb);
- }
-}
-
-// Check round-tripping when RGB565 -> RGB888 uses bit-duplication.
-void tst_QGLPickColors::roundTripDup565()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = qRed(rgb) & 0xF8;
- r = r | (r >> 5);
- g = qGreen(rgb) & 0xFC;
- g = g | (g >> 6);
- b = qBlue(rgb) & 0xF8;
- b = b | (b >> 5);
-
- QRgb duprgb = qRgb(r, g, b);
-
- QVERIFY(qt_qgl_normalize_pick_color(duprgb) == rgb);
- }
-}
-
-// Check round-tripping when RGB888 -> RGB555 uses truncation.
-void tst_QGLPickColors::roundTripTrunc555()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- QRgb truncrgb = qRgb(qRed(rgb) & 0xF8,
- qGreen(rgb) & 0xF8,
- qBlue(rgb) & 0xF8);
-
- QVERIFY(qt_qgl_normalize_pick_color(truncrgb) == rgb);
- }
-}
-
-// Check round-tripping when RGB888 -> RGB555 scales with floating point.
-void tst_QGLPickColors::roundTripScale555()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = int(qRed(rgb) * 31.0f / 255.0f);
- g = int(qGreen(rgb) * 31.0f / 255.0f);
- b = int(qBlue(rgb) * 31.0f / 255.0f);
-
- QRgb scalergb = qRgb(r * 255.0f / 31.0f,
- g * 255.0f / 31.0f,
- b * 255.0f / 31.0f);
-
- QVERIFY(qt_qgl_normalize_pick_color(scalergb) == rgb);
-
- // Scale up, but duplicate down.
- QRgb duprgb = qRgb((r << 3) | (r >> 2),
- (g << 3) | (g >> 2),
- (b << 3) | (b >> 2));
-
- QVERIFY(qt_qgl_normalize_pick_color(duprgb) == rgb);
- }
-}
-
-// Check round-tripping when RGB555 -> RGB888 uses bit-duplication.
-void tst_QGLPickColors::roundTripDup555()
-{
- int index = 0;
- QRgb rgb;
- while ((rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = qRed(rgb) & 0xF8;
- r = r | (r >> 5);
- g = qGreen(rgb) & 0xF8;
- g = g | (g >> 5);
- b = qBlue(rgb) & 0xF8;
- b = b | (b >> 5);
-
- QRgb duprgb = qRgb(r, g, b);
-
- QVERIFY(qt_qgl_normalize_pick_color(duprgb) == rgb);
- }
-}
-
-// Note: the RGB444 conversion falls apart after 1330 entries
-// in the table. It is no longer possible to distinguish the
-// colors while retaining stability in the face of GPU differences.
-#define RGB_444_LIMIT 1330
-
-// Check round-tripping when RGB888 -> RGB444 scales with floating point.
-void tst_QGLPickColors::roundTripScale444()
-{
- int index = 0;
- QRgb rgb;
- while (index < RGB_444_LIMIT && (rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = int(qRed(rgb) * 15.0f / 255.0f);
- g = int(qGreen(rgb) * 15.0f / 255.0f);
- b = int(qBlue(rgb) * 15.0f / 255.0f);
-
- QRgb scalergb = qRgb(r * 255.0f / 15.0f,
- g * 255.0f / 15.0f,
- b * 255.0f / 15.0f);
-
- QVERIFY(qt_qgl_normalize_pick_color(scalergb, true) == rgb);
- }
-}
-
-// Check round-tripping when RGB444 -> RGB888 uses bit-duplication.
-// We assume that the values are scaled up, but duplicated down.
-void tst_QGLPickColors::roundTripDup444()
-{
- int index = 0;
- QRgb rgb;
- while (index < RGB_444_LIMIT && (rgb = qt_qgl_pick_color(index++)) != 0) {
- int r, g, b;
- r = int(qRed(rgb) * 15.0f / 255.0f);
- r = r | (r << 4);
- g = int(qGreen(rgb) * 15.0f / 255.0f);
- g = g | (g << 4);
- b = int(qBlue(rgb) * 15.0f / 255.0f);
- b = b | (b << 4);
-
- QRgb duprgb = qRgb(r, g, b);
-
- QVERIFY(qt_qgl_normalize_pick_color(duprgb, true) == rgb);
- }
-}
-
-QTEST_APPLESS_MAIN(tst_QGLPickColors)
-
-#include "tst_qglpickcolors.moc"
diff --git a/tests/auto/threed/qglrender/qglrender.pro b/tests/auto/threed/qglrender/qglrender.pro
deleted file mode 100644
index 92da8840..00000000
--- a/tests/auto/threed/qglrender/qglrender.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qglrender
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglrender.cpp
-QT+=widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qglrender/tst_qglrender.cpp b/tests/auto/threed/qglrender/tst_qglrender.cpp
deleted file mode 100644
index c69f5236..00000000
--- a/tests/auto/threed/qglrender/tst_qglrender.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include <QtGui/QOpenGLContext>
-
-#include "qglrenderorder.h"
-#include "qglrendersequencer.h"
-#include "qglrenderordercomparator.h"
-#include "qglscenenode.h"
-#include "qglpainter.h"
-#include "qglbuilder.h"
-#include "qglview.h"
-
-class tst_QGLRender : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLRender() {}
- ~tst_QGLRender() {}
-
-private slots:
- void create();
- void values();
- void repo();
- void sequence();
-};
-
-void tst_QGLRender::create()
-{
- QGLSceneNode node;
- QGLSceneNode node2;
- QGLMaterialCollection pal;
- node.setPalette(&pal);
- node2.setPalette(&pal);
-
- QGLRenderState s;
- QGLRenderOrder order(&node, s);
- QGLRenderOrder other(order); // copy constructor
- QCOMPARE(order.node(), &node);
- QCOMPARE(order.node(), other.node());
- QGLRenderOrderComparator cmp;
- QVERIFY(cmp.isEqualTo(order, other)); // operator==
-
- QGLRenderOrder other2(&node2, s);
- QVERIFY(cmp.isEqualTo(other2, order)); // same because nodes have same values
- other2 = order; // operator=
- QVERIFY(cmp.isEqualTo(other2, order)); // same again
-
- QGLRenderState state0;
- QGLRenderOrder other3(&node2, state0);
- QVERIFY(cmp.isEqualTo(other2, other3));
-}
-
-void tst_QGLRender::values()
-{
- QGLSceneNode node; // by default has QGL::FlatColor
- QGLSceneNode node2;
- QGLMaterialCollection pal;
- node.setPalette(&pal);
- node2.setPalette(&pal);
- node2.setEffect(QGL::LitMaterial);
-
- QGLRenderState s;
- QGLRenderOrder order(&node, s);
- QGLRenderOrder other(&node2, s);
- QGLRenderOrderComparator cmp;
- QVERIFY(!cmp.isEqualTo(other, order));
- QVERIFY(cmp.isLessThan(order, other));
-
- QGLRenderState state;
- QGLMaterial *mat = new QGLMaterial;
- mat->setAmbientColor(Qt::blue);
- int ix = pal.addMaterial(mat);
- QGLSceneNode node3;
- node3.setPalette(&pal);
- node3.setMaterialIndex(ix);
- node3.setEffect(QGL::LitMaterial);
- state.updateFrom(&node3);
- QGLRenderOrder other2(&node, state);
- QVERIFY(other2.effectiveHasEffect());
- QCOMPARE(other2.effectiveMaterial(), mat);
- QCOMPARE(other2.effectiveStandardEffect(), QGL::LitMaterial);
- QCOMPARE(other2.effectiveUserEffect(), (QGLAbstractEffect*)0);
- QVERIFY(cmp.isLessThan(order, other2));
- QVERIFY(cmp.isLessThan(other, other2));
-}
-
-void tst_QGLRender::repo()
-{
- QGLSceneNode node; // by default has QGL::FlatColor
- QGLSceneNode node2;
- QGLMaterialCollection pal;
- node.setPalette(&pal);
- node2.setPalette(&pal);
- node2.setEffect(QGL::LitDecalTexture2D);
-
- QGLRenderState s;
- QGLRenderOrder order(&node, s);
- QGLRenderOrder other(&node2, s);
- QGLRenderOrder order2(&node, s);
- QGLRenderOrderComparator cmp;
- QVERIFY(!cmp.isEqualTo(other, order));
- QVERIFY(cmp.isLessThan(order, other));
- QVERIFY(cmp.isEqualTo(order2, order));
- QCOMPARE(order2.node(), order.node());
-}
-
-class TestPainter : public QGLPainter
-{
-public:
- TestPainter(QWindow *w) : QGLPainter(w) {}
- void draw(QGL::DrawingMode mode, const QGLIndexBuffer& indices,
- int offset, int count)
- {
- m_starts.append(offset);
- m_counts.append(count);
- QGLPainter::draw(mode, indices, offset, count);
- }
- QList<int> starts() const { return m_starts; }
- QList<int> counts() const { return m_counts; }
-private:
- QList<int> m_starts;
- QList<int> m_counts;
-};
-
-class TestView : public QGLView
-{
-public:
- TestView(QGLSceneNode *node)
- : m_node(node)
- {}
- void paintGL(QGLPainter *painter)
- {
- painter->setEye(QGL::NoEye);
- painter->setCamera(camera());
- m_node->draw(painter);
- }
-private:
- QGLSceneNode *m_node;
-};
-
-void tst_QGLRender::sequence()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- QGLMaterialCollection *palette = new QGLMaterialCollection;
-
- // create a yellow lit material
- QGLMaterial *mat = new QGLMaterial;
- mat->setAmbientColor(Qt::yellow);
- int ix0 = palette->addMaterial(mat);
-
- // create a blue lit material
- mat = new QGLMaterial;
- mat->setAmbientColor(Qt::blue);
- int ix1 = palette->addMaterial(mat);
-
- // create a grey textured material
- int tx0;
- {
- QImage uv(1024, 1024, QImage::Format_ARGB32);
- uv.fill(qRgba(196, 196, 196, 196));
- mat = new QGLMaterial;
- mat->setAmbientColor(Qt::gray);
- QGLTexture2D *tex = new QGLTexture2D;
- tex->setImage(uv);
- mat->setTexture(tex);
- tx0 = palette->addMaterial(mat);
- }
-
- QGLSceneNode *scene = new QGLSceneNode;
- scene->setPalette(palette);
- QGLSceneNode *node = 0;
- QGLSceneNode *prim;
- {
- QGLBuilder builder(palette);
- QVector3D a(-1.0f, -1.0f, 0.0f);
- QVector3D b(1.0f, -1.0f, 0.0f);
- QVector3D c(1.0f, 1.0f, 0.0f);
- QGeometryData p;
- p.appendVertex(a, b, c);
- p.generateTextureCoordinates();
- builder.addTriangles(p);
- prim = builder.currentNode();
- prim->setMaterialIndex(ix0);
- builder.newSection();
- QVector3D d(-1.2f, -1.2f, 0.0f);
- QVector3D e(1.2f, -1.2f, 0.0f);
- QVector3D f(1.2f, 1.2f, 0.0f);
- QVector3D g(-1.2f, 1.2f, 0.0f);
- QGeometryData q;
- q.appendVertex(d, e, f, g);
- q.generateTextureCoordinates();
- builder.addQuads(q);
- prim = builder.currentNode();
- prim->setMaterialIndex(ix1);
- node = builder.finalizedSceneNode();
- }
-
- scene->addNode(node);
- QGLSceneNode *cl = prim->clone(scene);
- cl->setMaterialIndex(tx0);
- cl->setEffect(QGL::LitDecalTexture2D);
-
- TestView widget(scene);
- if (!widget.context()->isValid())
- QSKIP("GL Implementation not valid");
-
- TestPainter *ptr = new TestPainter(&widget);
-
- widget.paintGL(ptr);
-
- QList<int> starts = ptr->starts();
- QList<int> counts = ptr->counts();
- QCOMPARE(starts.at(0), 0);
- QCOMPARE(counts.at(0), 3);
- QCOMPARE(starts.at(1), 3);
- QCOMPARE(counts.at(1), 6);
-}
-
-QTEST_MAIN(tst_QGLRender)
-
-#include "tst_qglrender.moc"
diff --git a/tests/auto/threed/qglscenenode/qglscenenode.pro b/tests/auto/threed/qglscenenode/qglscenenode.pro
deleted file mode 100644
index 489302ff..00000000
--- a/tests/auto/threed/qglscenenode/qglscenenode.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = tst_qglscenenode
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglscenenode.cpp
-QT+=widgets
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp b/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp
deleted file mode 100644
index ca283798..00000000
--- a/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp
+++ /dev/null
@@ -1,780 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtGui/QOpenGLContext>
-
-#include "qglscenenode.h"
-#include "qglpainter.h"
-#include "qglabstracteffect.h"
-#include "qglpicknode.h"
-#include "qgraphicstransform3d.h"
-#include "qgraphicsscale3d.h"
-#include "qgraphicsrotation3d.h"
-#include "qglbuilder.h"
-
-#include "qtest_helpers.h"
-
-class tst_QGLSceneNode : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLSceneNode() {}
- ~tst_QGLSceneNode() {}
-
-private slots:
- void defaultValues();
- void modify();
- void addNode();
- void removeNode();
- void clone();
- void boundingBox_data();
- void boundingBox();
- void position_QTBUG_17279();
-};
-
-// Check that all properties have their expected defaults.
-void tst_QGLSceneNode::defaultValues()
-{
- QGLSceneNode node;
- QVERIFY(node.options() == QGLSceneNode::NoOptions);
- QVERIFY(node.geometry().isNull());
- QVERIFY(node.boundingBox().isNull());
- QVERIFY(node.localTransform().isIdentity());
-
- QVERIFY(node.position() == QVector3D(0, 0, 0));
- QCOMPARE(node.x(), qreal(0.0f));
- QCOMPARE(node.y(), qreal(0.0f));
- QCOMPARE(node.z(), qreal(0.0f));
-
- QVERIFY(node.transforms().isEmpty());
-
- QVERIFY(node.drawingMode() == QGL::Triangles);
- QVERIFY(node.effect() == QGL::FlatColor);
- QVERIFY(node.userEffect() == 0);
- QVERIFY(!node.hasEffect());
-
- QCOMPARE(node.start(), 0);
- QCOMPARE(node.count(), 0);
-
- QCOMPARE(node.materialIndex(), -1);
- QCOMPARE(node.backMaterialIndex(), -1);
-
- QVERIFY(node.material() == 0);
- QVERIFY(node.backMaterial() == 0);
- QVERIFY(node.palette() == 0);
- QVERIFY(node.pickNode() == 0);
-
- QVERIFY(node.allChildren().isEmpty());
- QVERIFY(node.children().isEmpty());
-}
-
-class TestEffect : public QGLAbstractEffect
-{
-public:
- void setActive(QGLPainter *, bool) {}
- void update(QGLPainter *, QGLPainter::Updates) {}
-};
-
-// Modify properties and check that the modifications propagate.
-void tst_QGLSceneNode::modify()
-{
- QGLSceneNode node;
-
- QSignalSpy updatedSpy(&node, SIGNAL(updated()));
-
- node.setOptions(QGLSceneNode::ViewNormals);
- QCOMPARE(updatedSpy.count(), 1);
- QVERIFY(node.options() == QGLSceneNode::ViewNormals);
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- node.setLocalTransform(m);
- QCOMPARE(updatedSpy.count(), 2);
- QVERIFY(node.localTransform() == m);
-
- node.setPosition(QVector3D(1, -2, 3));
- QCOMPARE(updatedSpy.count(), 3);
- QVERIFY(node.position() == QVector3D(1, -2, 3));
-
- node.setX(-45.0f);
- QCOMPARE(updatedSpy.count(), 4);
- QVERIFY(node.position() == QVector3D(-45.0f, -2, 3));
-
- node.setY(67.0f);
- QCOMPARE(updatedSpy.count(), 5);
- QVERIFY(node.position() == QVector3D(-45.0f, 67.0f, 3));
-
- node.setZ(-23.5f);
- QCOMPARE(updatedSpy.count(), 6);
- QVERIFY(node.position() == QVector3D(-45.0f, 67.0f, -23.5f));
-
- QList<QGraphicsTransform3D *> transforms;
- transforms.append(new QGraphicsScale3D(this));
- transforms.append(new QGraphicsRotation3D(this));
- node.setTransforms(transforms);
- QCOMPARE(updatedSpy.count(), 7);
- QVERIFY(node.transforms() == transforms);
-
- QGraphicsScale3D *scale = new QGraphicsScale3D(this);
- transforms.append(scale);
- node.addTransform(scale);
- QCOMPARE(updatedSpy.count(), 8);
- QVERIFY(node.transforms() == transforms);
-
- node.setDrawingMode(QGL::Points);
- QCOMPARE(updatedSpy.count(), 9);
- QVERIFY(node.drawingMode() == QGL::Points);
-
- node.setEffect(QGL::LitMaterial);
- QCOMPARE(updatedSpy.count(), 10);
- QVERIFY(node.effect() == QGL::LitMaterial);
- QVERIFY(node.hasEffect());
-
- node.setEffectEnabled(false);
- QCOMPARE(updatedSpy.count(), 11);
- QVERIFY(node.effect() == QGL::LitMaterial);
- QVERIFY(!node.hasEffect());
-
- TestEffect userEffect;
- node.setUserEffect(&userEffect);
- QCOMPARE(updatedSpy.count(), 12);
- QVERIFY(node.effect() == QGL::LitMaterial);
- QVERIFY(node.userEffect() == &userEffect);
- QVERIFY(node.hasEffect());
-
- node.setMaterialIndex(3);
- QCOMPARE(updatedSpy.count(), 13);
- QCOMPARE(node.materialIndex(), 3);
- QVERIFY(node.material() == 0); // material index is out of range
-
- node.setBackMaterialIndex(5);
- QCOMPARE(updatedSpy.count(), 14);
- QCOMPARE(node.backMaterialIndex(), 5);
- QVERIFY(node.backMaterial() == 0); // material index is out of range
-
- QVERIFY(node.palette() == 0);
-
- QGLMaterial *mat1 = new QGLMaterial();
- node.setMaterial(mat1);
- QCOMPARE(updatedSpy.count(), 15);
- QCOMPARE(node.materialIndex(), 0);
- QCOMPARE(node.backMaterialIndex(), 5);
- QVERIFY(node.material() == mat1);
- QVERIFY(node.backMaterial() == 0);
- QVERIFY(node.palette() != 0);
-
- QGLMaterial *mat2 = new QGLMaterial();
- node.setBackMaterial(mat2);
- QCOMPARE(updatedSpy.count(), 16);
- QCOMPARE(node.materialIndex(), 0);
- QCOMPARE(node.backMaterialIndex(), 1);
- QVERIFY(node.material() == mat1);
- QVERIFY(node.backMaterial() == mat2);
-
- QGLMaterial *mat3 = new QGLMaterial();
- node.setMaterial(mat3);
- QCOMPARE(updatedSpy.count(), 17);
- QCOMPARE(node.materialIndex(), 2);
- QCOMPARE(node.backMaterialIndex(), 1);
- QVERIFY(node.material() == mat3);
- QVERIFY(node.backMaterial() == mat2);
-
- node.setMaterial(mat1);
- QCOMPARE(updatedSpy.count(), 18);
- QCOMPARE(node.materialIndex(), 0);
- QCOMPARE(node.backMaterialIndex(), 1);
- QVERIFY(node.material() == mat1);
- QVERIFY(node.backMaterial() == mat2);
-
- QVERIFY(node.palette()->material(0) == mat1);
- QVERIFY(node.palette()->material(1) == mat2);
- QVERIFY(node.palette()->material(2) == mat3);
- QCOMPARE(node.palette()->size(), 3);
-
- QGLPickNode pick;
- QVERIFY(pick.target() == 0);
- QCOMPARE(pick.id(), -1);
- node.setPickNode(&pick);
- QVERIFY(node.pickNode() == &pick);
- QVERIFY(pick.target() == &node);
- QCOMPARE(pick.id(), -1);
- pick.setId(4);
- QCOMPARE(pick.id(), 4);
-
- // One last check to make sure there are no leaks between properties.
- // e.g. the position actually changing the rotation, etc.
- QVERIFY(node.options() == QGLSceneNode::ViewNormals);
- QVERIFY(node.localTransform() == m);
- QVERIFY(node.position() == QVector3D(-45.0f, 67.0f, -23.5f));
- QVERIFY(node.transforms() == transforms);
- QVERIFY(node.drawingMode() == QGL::Points);
- QVERIFY(node.effect() == QGL::LitMaterial);
- QVERIFY(node.userEffect() == &userEffect);
- QVERIFY(node.hasEffect());
- QCOMPARE(node.materialIndex(), 0);
- QCOMPARE(node.backMaterialIndex(), 1);
- QVERIFY(node.pickNode() == &pick);
-}
-
-// Add nodes to build a scene graph.
-void tst_QGLSceneNode::addNode()
-{
- QGLSceneNode *node1 = new QGLSceneNode();
-
- // Add a node via the constructor.
- QGLSceneNode *node2 = new QGLSceneNode(node1);
- QVERIFY(node2->parent() == node1);
- QCOMPARE(node1->children().count(), 1);
- QVERIFY(node1->children()[0] == node2);
-
- // Add a node explicitly, not parented into the graph yet.
- // Because node3's parent is null, it will be parented in.
- QGLSceneNode *node3 = new QGLSceneNode();
- node1->addNode(node3);
- QVERIFY(node3->parent() == node1);
- QCOMPARE(node1->children().count(), 2);
- QVERIFY(node1->children()[0] == node2);
- QVERIFY(node1->children()[1] == node3);
-
- // Add a node explicily that is parented elsewhere. Because
- // node4's parent is not null, it will *not* be parented in.
- QGLSceneNode *node4 = new QGLSceneNode(this);
- node1->addNode(node4);
- QVERIFY(node4->parent() == this);
- QCOMPARE(node1->children().count(), 3);
- QVERIFY(node1->children()[0] == node2);
- QVERIFY(node1->children()[1] == node3);
- QVERIFY(node1->children()[2] == node4);
-
- // Try adding node4 again (should do nothing).
- node1->addNode(node4);
- QVERIFY(node4->parent() == this);
- QCOMPARE(node1->children().count(), 3);
- QVERIFY(node1->children()[0] == node2);
- QVERIFY(node1->children()[1] == node3);
- QVERIFY(node1->children()[2] == node4);
-
- // Add a null child (should do nothing).
- node1->addNode(0);
- QCOMPARE(node1->children().count(), 3);
- QVERIFY(node1->children()[0] == node2);
- QVERIFY(node1->children()[1] == node3);
- QVERIFY(node1->children()[2] == node4);
-
- // Add node3 under node2 as well so that it has multiple parents.
- node2->addNode(node3);
- QVERIFY(node3->parent() == node1); // parent is unchanged
- QCOMPARE(node1->children().count(), 3);
- QVERIFY(node1->children()[0] == node2);
- QVERIFY(node1->children()[1] == node3);
- QVERIFY(node1->children()[2] == node4);
- QCOMPARE(node2->children().count(), 1);
- QVERIFY(node2->children()[0] == node3);
-
- // Recursively fetch all children.
- QList<QGLSceneNode *> children = node1->allChildren();
- QCOMPARE(children.count(), 3);
- QVERIFY(children[0] == node2);
- QVERIFY(children[1] == node3);
- QVERIFY(children[2] == node4);
- children = node2->allChildren();
- QCOMPARE(children.count(), 1);
- QVERIFY(children[0] == node3);
- QVERIFY(node3->allChildren().isEmpty());
- QVERIFY(node4->allChildren().isEmpty());
-
- // Delete the top node and ensure that the right objects are destroyed.
- QSignalSpy node1Spy(node1, SIGNAL(destroyed()));
- QSignalSpy node2Spy(node2, SIGNAL(destroyed()));
- QSignalSpy node3Spy(node3, SIGNAL(destroyed()));
- QSignalSpy node4Spy(node4, SIGNAL(destroyed()));
- delete node1;
- QCOMPARE(node1Spy.count(), 1);
- QCOMPARE(node2Spy.count(), 1);
- QCOMPARE(node3Spy.count(), 1);
- QCOMPARE(node4Spy.count(), 0);
-
- // Clean up the separate node.
- delete node4;
- QCOMPARE(node4Spy.count(), 1);
-}
-
-// Remove nodes from an existing scene graph.
-void tst_QGLSceneNode::removeNode()
-{
- QGLSceneNode *node1 = new QGLSceneNode();
- QGLSceneNode *node2 = new QGLSceneNode();
- QGLSceneNode *node3 = new QGLSceneNode();
- QGLSceneNode *node4 = new QGLSceneNode();
- QGLSceneNode *node5 = new QGLSceneNode(this);
-
- node1->addNode(node2);
- node1->addNode(node3);
- node1->addNode(node4);
- node2->addNode(node3);
- node2->addNode(node5);
-
- QSignalSpy node1Spy(node1, SIGNAL(destroyed()));
- QSignalSpy node2Spy(node2, SIGNAL(destroyed()));
- QSignalSpy node3Spy(node3, SIGNAL(destroyed()));
- QSignalSpy node4Spy(node4, SIGNAL(destroyed()));
- QSignalSpy node5Spy(node5, SIGNAL(destroyed()));
-
- // Removing a node will set its parent pointer back to null
- // if it was removed from its last parent.
- QVERIFY(node4->parent() == node1);
- node1->removeNode(node4);
- QVERIFY(node4->parent() == 0);
-
- // The node should still exist, just detached.
- QCOMPARE(node4Spy.count(), 0);
- delete node4;
- QCOMPARE(node4Spy.count(), 1);
-
- // Remove node3, which should transfer ownership.
- QVERIFY(node3->parent() == node1);
- node1->removeNode(node3);
- QVERIFY(node3->parent() == node2);
-
- // Add node3 back, and check non-transfer of ownership.
- node1->addNode(node3);
- QVERIFY(node3->parent() == node2);
- node1->removeNode(node3);
- QVERIFY(node3->parent() == node2);
-
- // Remove a node that wasn't parented to the scene graph.
- node2->removeNode(node5);
- QVERIFY(node5->parent() == this);
-
- // Clean up the rest of the graph.
- QCOMPARE(node1Spy.count(), 0);
- QCOMPARE(node2Spy.count(), 0);
- QCOMPARE(node3Spy.count(), 0);
- QCOMPARE(node4Spy.count(), 1);
- QCOMPARE(node5Spy.count(), 0);
- delete node1;
- QCOMPARE(node1Spy.count(), 1);
- QCOMPARE(node2Spy.count(), 1);
- QCOMPARE(node3Spy.count(), 1);
- QCOMPARE(node4Spy.count(), 1);
- QCOMPARE(node5Spy.count(), 0);
- delete node5;
- QCOMPARE(node5Spy.count(), 1);
-}
-
-static bool sameTransforms(const QList<QGraphicsTransform3D *> &transforms1,
- const QList<QGraphicsTransform3D *> &transforms2)
-{
- if (transforms1.size() != transforms2.size())
- return false;
- for (int index = 0; index < transforms1.size(); ++index) {
- // We only check the meta object at the moment, and assume
- // that the clone() worked properly.
- if (transforms1.at(index)->metaObject() !=
- transforms2.at(index)->metaObject())
- return false;
- }
- return true;
-}
-
-void tst_QGLSceneNode::clone()
-{
- QGLSceneNode nodeParent;
- QGLSceneNode node1(&nodeParent);
-
- QGLSceneNode *node2 = node1.clone();
- QVERIFY(node2 != 0 && node2 != &node1);
- QVERIFY(node2->parent() == &nodeParent);
- QVERIFY(node2->options() == node1.options());
- QVERIFY(node2->geometry().isEmpty());
- QVERIFY(node2->localTransform().isIdentity());
- QVERIFY(node2->position() == QVector3D(0, 0, 0));
- QVERIFY(node2->transforms().isEmpty());
- QVERIFY(node2->drawingMode() == QGL::Triangles);
- QVERIFY(node2->effect() == QGL::FlatColor);
- QVERIFY(!node2->userEffect());
- QVERIFY(!node2->hasEffect());
- QCOMPARE(node2->start(), 0);
- QCOMPARE(node2->count(), 0);
- QCOMPARE(node2->materialIndex(), -1);
- QCOMPARE(node2->backMaterialIndex(), -1);
- QVERIFY(!node2->palette());
- QVERIFY(!node2->pickNode());
- QVERIFY(node2->children().isEmpty());
- delete node2;
-
- QGeometryData data1;
- data1.appendVertex(QVector3D(1, -2, 3));
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
- TestEffect userEffect;
- QGLPickNode pick;
- QList<QGraphicsTransform3D *> transforms;
- transforms.append(new QGraphicsScale3D(this));
- transforms.append(new QGraphicsRotation3D(this));
-
- node1.setOptions(QGLSceneNode::ViewNormals);
- node1.setGeometry(data1);
- node1.setLocalTransform(m);
- node1.setPosition(QVector3D(1, -2, 3));
- node1.setTransforms(transforms);
- node1.setDrawingMode(QGL::Points);
- node1.setEffect(QGL::LitMaterial);
- node1.setUserEffect(&userEffect);
- node1.setStart(10);
- node1.setCount(20);
- QGLMaterial *mat1 = new QGLMaterial();
- QGLMaterial *mat2 = new QGLMaterial();
- node1.setMaterial(mat1);
- node1.setBackMaterial(mat2);
- node1.setPickNode(&pick);
- QGLSceneNode *node3 = new QGLSceneNode();
- QGLSceneNode *node4 = new QGLSceneNode();
- node1.addNode(node3);
- node1.addNode(node4);
-
- // Clone onto the same parent.
- node2 = node1.clone();
- QVERIFY(node2 != 0 && node2 != &node1);
- QVERIFY(node2->parent() == &nodeParent);
- QVERIFY(node2->options() == node1.options());
- QCOMPARE(node2->geometry().count(), 1);
- QVERIFY(node2->localTransform() == m);
- QVERIFY(node2->position() == QVector3D(1, -2, 3));
- QVERIFY(sameTransforms(node2->transforms(), transforms));
- QVERIFY(node2->drawingMode() == QGL::Points);
- QVERIFY(node2->effect() == QGL::LitMaterial);
- QVERIFY(node2->userEffect() == &userEffect);
- QVERIFY(node2->hasEffect());
- QCOMPARE(node2->start(), 10);
- QCOMPARE(node2->count(), 20);
- QCOMPARE(node2->materialIndex(), 0);
- QCOMPARE(node2->backMaterialIndex(), 1);
- QVERIFY(node2->material() == mat1);
- QVERIFY(node2->backMaterial() == mat2);
- QVERIFY(node2->palette() != 0);
- QVERIFY(node2->palette() == node1.palette());
- QVERIFY(!node2->pickNode()); // Pick node should not be cloned
- QCOMPARE(node2->children().count(), 2);
- QVERIFY(node2->children()[0] == node3);
- QVERIFY(node2->children()[1] == node4);
- delete node2;
-
- // Clone onto a different parent.
- QGLSceneNode node2Parent;
- node2 = node1.clone(&node2Parent);
- QVERIFY(node2->parent() == &node2Parent);
- QCOMPARE(node2Parent.children().count(), 1);
- QVERIFY(node2Parent.children()[0] == node2);
- delete node2;
-}
-
-void tst_QGLSceneNode::boundingBox_data()
-{
- QTest::addColumn<QVector3D>("bottomLeftFront");
- QTest::addColumn<QVector3D>("bottomRightFront");
- QTest::addColumn<QVector3D>("topRightFront");
- QTest::addColumn<QVector3D>("topLeftFront");
- QTest::addColumn<QVector3D>("scale");
- QTest::addColumn<QVector3D>("translation");
- QTest::addColumn<QVector3D>("rotation");
- QTest::addColumn<QVector3D>("boxMin");
- QTest::addColumn<QVector3D>("boxMax");
-
- QTest::newRow("cube-2x2x2-at-origin-no-xform")
- << QVector3D(-1, -1, -1)
- << QVector3D(1, -1, -1)
- << QVector3D(1, 1, -1)
- << QVector3D(-1, 1, -1)
- << QVector3D(0, 0, 0)
- << QVector3D(0, 0, 0)
- << QVector3D(0, 0, 0)
- << QVector3D(-1, -1, -1)
- << QVector3D(1, 1, 1);
-
- QTest::newRow("cube-2x2x2-offset-no-xform")
- << QVector3D(3, -1, -1)
- << QVector3D(5, -1, -1)
- << QVector3D(5, 1, -1)
- << QVector3D(3, 1, -1)
- << QVector3D(0, 0, 0)
- << QVector3D(0, 0, 0)
- << QVector3D(0, 0, 0)
- << QVector3D(3, -1, -1)
- << QVector3D(5, 1, 1);
-
- QTest::newRow("cube-2x2x2-at-origin-positioned")
- << QVector3D(-1, -1, -1)
- << QVector3D(1, -1, -1)
- << QVector3D(1, 1, -1)
- << QVector3D(-1, 1, -1)
- << QVector3D(0, 0, 0)
- << QVector3D(-4, -4, -4)
- << QVector3D(0, 0, 0)
- << QVector3D(-5, -5, -5)
- << QVector3D(-3, -3, -3);
-
- QTest::newRow("cube-2x2x2-offset-positioned")
- << QVector3D(3, -1, -1)
- << QVector3D(5, -1, -1)
- << QVector3D(5, 1, -1)
- << QVector3D(3, 1, -1)
- << QVector3D(0, 0, 0)
- << QVector3D(-4, -4, -4)
- << QVector3D(0, 0, 0)
- << QVector3D(-1, -5, -5)
- << QVector3D(1, -3, -3);
-
- QTest::newRow("cube-2x2x2-at-origin-positioned-scaled")
- << QVector3D(-1, -1, -1)
- << QVector3D(1, -1, -1)
- << QVector3D(1, 1, -1)
- << QVector3D(-1, 1, -1)
- << QVector3D(4, 4, 4)
- << QVector3D(-4, -4, -4)
- << QVector3D(0, 0, 0)
- << QVector3D(-20, -20, -20)
- << QVector3D(-12, -12, -12);
-
- QTest::newRow("cube-2x2x2-offset-positioned-scaled-rotated")
- << QVector3D(3, -1, -1)
- << QVector3D(5, -1, -1)
- << QVector3D(5, 1, -1)
- << QVector3D(3, 1, -1)
- << QVector3D(4, 4, 4)
- << QVector3D(-4, -4, -4)
- << QVector3D(0, 0, 45)
- << QVector3D(-4, -20, -20)
- << QVector3D(4, -12, -12);
-}
-
-void tst_QGLSceneNode::boundingBox()
-{
- QFETCH(QVector3D, bottomLeftFront);
- QFETCH(QVector3D, bottomRightFront);
- QFETCH(QVector3D, topRightFront);
- QFETCH(QVector3D, topLeftFront);
- QFETCH(QVector3D, scale);
- QFETCH(QVector3D, translation);
- QFETCH(QVector3D, rotation);
- QFETCH(QVector3D, boxMin);
- QFETCH(QVector3D, boxMax);
-
- QBox3D expBox(boxMin, boxMax);
- QGLSceneNode *node = new QGLSceneNode;
- node->setObjectName(QLatin1String("Root node"));
- QGLSceneNode *geoNode = 0;
- QGeometryData data;
- QGLBuilder builder;
-
- data.appendVertex(bottomLeftFront, bottomRightFront, topRightFront, topLeftFront);
- builder.addQuads(data); // top of cube
- builder.addQuadsInterleaved(data, data.translated(QVector3D(0, 0, 2))); // sides of cube
- builder.addQuads(data.reversed()); // bottom of cube
-
- geoNode = builder.finalizedSceneNode();
- geoNode->setObjectName("Geometry node");
- node->addNode(geoNode);
-
- if (!scale.isNull())
- {
- QMatrix4x4 m = node->localTransform();
- m.scale(scale);
- node->setLocalTransform(m);
- }
-
- if (!translation.isNull())
- {
- QMatrix4x4 m = node->localTransform();
- m.translate(translation);
- node->setLocalTransform(m);
- }
-
- if (!rotation.isNull())
- {
- QMatrix4x4 m = node->localTransform();
- if (qIsNull(rotation.x()))
- m.rotate(rotation.x(), 1.0, 0.0, 0.0);
- if (qIsNull(rotation.y()))
- m.rotate(rotation.y(), 0.0, 1.0, 0.0);
- if (qIsNull(rotation.z()))
- m.rotate(rotation.z(), 0.0, 0.0, 1.0);
- node->setLocalTransform(m);
- }
-
- QBox3D gotBox = node->boundingBox();
- QCOMPARE(gotBox.minimum(), expBox.minimum());
- QCOMPARE(gotBox.maximum(), expBox.maximum());
-
-
- // now clear out the root nodes transform and apply the same transform
- // to the child node - should be exactly the same
-
- QMatrix4x4 saveMat = node->localTransform();
- node->setLocalTransform(QMatrix4x4()); // set back to identity
- geoNode->setLocalTransform(saveMat);
-
- gotBox = node->boundingBox();
- QCOMPARE(gotBox.minimum(), expBox.minimum());
- QCOMPARE(gotBox.maximum(), expBox.maximum());
-
- delete node;
-}
-
-class TestSceneNode : public QGLSceneNode
-{
-public:
- QMatrix4x4 resultingModelView;
- QMatrix4x4 transformMatrix;
-
- TestSceneNode()
- : QGLSceneNode()
- {
- //
- }
-
-protected:
- virtual void drawGeometry(QGLPainter *painter)
- {
- resultingModelView = painter->modelViewMatrix().top();
-
- // basically reimplement the private function "transform()" here to get the value of the transforms
- QMatrix4x4 m;
- if (!position().isNull())
- m.translate(position());
- if (!localTransform().isIdentity())
- m *= localTransform();
- QList<QGraphicsTransform3D *> tx = transforms();
- for (int index = tx.size() - 1; index >= 0; --index)
- tx.at(index)->applyTo(&m);
-
- transformMatrix = m;
- }
-
-};
-
-static void ensureContext(QWindow &win, QOpenGLContext &ctx)
-{
- QSurfaceFormat format;
- format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
- ctx.setFormat(format);
-#ifndef QT_NO_DEBUG_STREAM
- QSurfaceFormat oldFormat = format;
-#endif
- ctx.create();
- // TODO: is it possible that the platform will downgrade the actual
- // format, or will it just fail if it can't deliver the actual format
- format = ctx.format();
-#ifndef QT_NO_DEBUG_STREAM
- if (oldFormat.swapBehavior() != format.swapBehavior())
- qWarning() << "Could not create context for swap behavior"
- << oldFormat.swapBehavior();
-#endif
- ctx.makeCurrent(&win);
-}
-
-void tst_QGLSceneNode::position_QTBUG_17279()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- QGeometryData geom;
- geom.appendVertex(QVector3D(0, 0, 0),
- QVector3D(1.414, 1.414, 0),
- QVector3D(2, 0, 0));
- TestSceneNode *node = new TestSceneNode;
-
- QVERIFY(node->resultingModelView.isIdentity());
- QVERIFY(node->transformMatrix.isIdentity());
-
- node->setGeometry(geom);
- node->setCount(3);
- node->setPosition(QVector3D(0.f, 0.f, -5.f));
-
- QVERIFY(node->localTransform().isIdentity());
- QCOMPARE(node->position().z(), -5.0);
-
- QWindow glw;
- glw.setSurfaceType(QWindow::OpenGLSurface);
- QOpenGLContext ctx;
- ensureContext(glw, ctx);
- if (!ctx.isValid())
- QSKIP("GL Implementation not valid");
-
- QGLPainter p(&glw);
- QGLCamera cam;
- p.setCamera(&cam);
-
- QMatrix4x4 m = p.modelViewMatrix().top();
-
- node->draw(&p);
-
- QVERIFY(m == p.modelViewMatrix().top());
-
- QCOMPARE(node->resultingModelView(2, 3), -15.0);
- QCOMPARE(node->transformMatrix(2, 3), -5.0);
-
- QGeometryData geom2;
- geom2.appendVertex(QVector3D(0, 0, 0),
- QVector3D(-1.414, 1.414, 0),
- QVector3D(-2, 0, 0));
- TestSceneNode *node2 = new TestSceneNode;
- node2->setGeometry(geom2);
- node2->setCount(3);
- node2->setPosition(QVector3D(0.f, -1.f, -5.f));
-
- node2->draw(&p);
-
- QVERIFY(m == p.modelViewMatrix().top());
-
- QCOMPARE(node2->resultingModelView(1, 3), -1.0);
- QCOMPARE(node2->transformMatrix(1, 3), -1.0);
- QCOMPARE(node2->resultingModelView(2, 3), -15.0);
- QCOMPARE(node2->transformMatrix(2, 3), -5.0);
-}
-
-QTEST_MAIN(tst_QGLSceneNode)
-
-#include "tst_qglscenenode.moc"
diff --git a/tests/auto/threed/qglsection/qglsection.pro b/tests/auto/threed/qglsection/qglsection.pro
deleted file mode 100644
index 7a64d983..00000000
--- a/tests/auto/threed/qglsection/qglsection.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TARGET = tst_qglsection
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglsection.cpp
-INCLUDEPATH += ../../../../src/threed/geometry
diff --git a/tests/auto/threed/qglsection/tst_qglsection.cpp b/tests/auto/threed/qglsection/tst_qglsection.cpp
deleted file mode 100644
index 726a995b..00000000
--- a/tests/auto/threed/qglsection/tst_qglsection.cpp
+++ /dev/null
@@ -1,674 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglsection_p.h"
-#include "qglbuilder.h"
-#include "qgeometrydata.h"
-#include "qtest_helpers.h"
-#include "qvector3darray.h"
-
-class tst_QGLSection : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLSection() {}
- ~tst_QGLSection() {}
- void testSmooth(QGLSection *sec, QGLBuilder *builder);
- void testFaceted(QGLSection *sec, QGLBuilder *builder);
-
-private slots:
- void create();
- void modify();
- void append();
- void appendSmooth();
- void appendSmoothMap();
- void appendFaceted();
- void appendFacetedMap();
- void accumNormals();
- void normalizedNormals();
- void appendTexCoord();
- void appendColor();
- void accessors();
-};
-
-// Indices in a QGLIndexArray are int on desktop, ushort on OpenGL/ES.
-// This macro works around the discrepancy to avoid confusing QCOMPARE.
-#define QCOMPARE_INDEX(x,y) QCOMPARE(int(x), int(y))
-
-class QGLSectionTest : public QGLSection
-{
-public:
- QGLSectionTest(QGLBuilder *builder, QGL::Smoothing s = QGL::Smooth)
- : QGLSection(builder, s) {}
-
- void appendSmooth(const QLogicalVertex &vertex)
- {
- QGLSection::appendSmooth(vertex);
- }
-
- void appendFaceted(const QLogicalVertex &vertex)
- {
- QGLSection::appendFaceted(vertex);
- }
-
- void append(const QLogicalVertex &vertex)
- {
- QGLSection::append(vertex);
- }
-};
-
-class TestBuilder : public QGLBuilder
-{
-public:
- QGLSection *currentSection() { return QGLBuilder::currentSection(); }
- QList<QGLSection*> sections() { return QGLBuilder::sections(); }
-};
-
-static void addGeometry(TestBuilder &builder)
-{
- QVector3D va(-1.0f, -1.0f, 0.0f);
- QVector3D vb(1.0f, -1.0f, 0.0f);
- QVector3D vc(1.0f, 1.0f, 0.0f);
- QGeometryData p;
- p.appendVertex(va, vb, vc);
- builder.addTriangles(p);
-}
-
-void tst_QGLSection::create()
-{
- // Test that a newly created object has the correct defaults.
- TestBuilder builder;
- builder.newSection();
- QGLSection *section = builder.currentSection();
- QVERIFY(section->hasField(QGL::Position)); // need this initially now
- QCOMPARE(section->fields(), (quint32)1);
- QCOMPARE(section->smoothing(), QGL::Smooth);
- QCOMPARE(section->count(), 0);
- QCOMPARE(section->boundingBox(), QBox3D());
- QCOMPARE(section->mapThreshold(), 5);
-
- // suppress warning
- addGeometry(builder);
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::modify()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSection *section = builder.currentSection();
-
- QVector3D va(-1.0f, -1.0f, 0.0f);
- QVector3D vb(1.0f, -1.0f, 0.0f);
- QVector3D vc(1.0f, 1.0f, 0.0f);
- QVector3D n(0.0f, 0.0f, 1.0f);
- QGeometryData p;
- p.appendVertex(va, vb, vc);
- p.appendNormal(n, n, n);
- section->setMapThreshold(30);
- QCOMPARE(section->mapThreshold(), 30);
- builder.addTriangles(p);
- QCOMPARE(section->count(), 3);
- builder.newSection();
- QGLSection *section2 = builder.currentSection();
- builder.addTriangles(p);
- QCOMPARE(section2->count(), 3);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::append()
-{
- TestBuilder builder;
- builder.newSection();
- QGLSection *section = builder.currentSection();
-
- QVector3D testVertex(1.234f, 2.345f, 3.456f);
- QVector3D testNormal(1.0f, 0.0f, 0.0f);
- QLogicalVertex vx(testVertex, testNormal);
- section->append(vx);
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal);
- QCOMPARE(section->indices().size(), 1);
- QCOMPARE(section->texCoords().count(), 0);
- QCOMPARE(section->colors().count(), 0);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::appendSmooth()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
- testSmooth(section, &builder);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::appendSmoothMap()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
- int t = section->mapThreshold();
- QVector3D testVertex(-12.34f, -23.45f, -34.56f);
- QVector3D incrVector(0.02, 0.02, 0.02);
- QVector3D testNormal(1.0f, 0.0f, 0.0f);
- for (int i = 0; i < (t - 2); ++i)
- {
- section->appendSmooth(QLogicalVertex(testVertex, testNormal));
- testVertex += incrVector;
- }
- testSmooth(section, &builder);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::testSmooth(QGLSection *section, QGLBuilder *builder)
-{
- int poffset = section->count(QGL::Position);
- int noffset = section->count(QGL::Normal);
-
- // append a vertex - check it appears in the data along with its normal
- QVector3D testVertex(1.234f, 2.345f, 3.456f);
- QVector3D testNormal(4.321f, 5.432f, 6.543f);
- section->appendSmooth(QLogicalVertex(testVertex, testNormal));
- QCOMPARE(section->vertices().count(), poffset + 1);
- QCOMPARE(section->vertices().at(poffset + 0), testVertex);
- QCOMPARE(section->normals().count(), noffset + 1);
- QCOMPARE(section->normals().at(noffset + 0), testNormal);
- QCOMPARE(section->indices().size(), poffset + 1);
- QCOMPARE_INDEX(section->indices()[poffset + 0], poffset + 0);
-
- // append a vertex equal to one already appended - check it was coalesced
- QVector3D testNormal2(0.0f, 0.0f, 1.0f);
- QVector3D result = testNormal + testNormal2; // QVector3D(0.0f, 0.0f, 7.543f);
- section->appendSmooth(QLogicalVertex(testVertex, testNormal2));
- QCOMPARE(section->vertices().count(), poffset + 1);
- QCOMPARE(section->vertices().at(poffset + 0), testVertex);
- QCOMPARE(section->normals().count(), noffset + 1);
- QCOMPARE(section->normals().at(noffset + 0), result);
- QCOMPARE(section->indices().size(), poffset + 2);
- QCOMPARE_INDEX(section->indices()[poffset + 1], poffset + 0);
-
- // append a new different vertex - check it is not coalesced
- QVector3D testVertex2(-1.234f, -2.345f, -3.456f);
- QVector3D testNormal3(-4.321f, -5.432f, -6.543f);
- section->appendSmooth(QLogicalVertex(testVertex2, testNormal3));
- QCOMPARE(section->vertices().count(), poffset + 2);
- QCOMPARE(section->vertices().at(poffset + 1), testVertex2);
- QCOMPARE(section->normals().count(), noffset + 2);
- QCOMPARE(section->normals().at(noffset + 1), testNormal3);
- QCOMPARE(section->indices().size(), poffset + 3);
- QCOMPARE_INDEX(section->indices()[poffset + 2], poffset + 1);
-
- // append a vertex equal to one already appended, but inside a new section - check its not coalesced
- section = new QGLSectionTest(builder);
- section->appendSmooth(QLogicalVertex(testVertex2, testNormal3));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex2);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal3);
- QCOMPARE(section->indices().size(), 1);
- QCOMPARE_INDEX(section->indices()[0], 0);
-}
-
-void tst_QGLSection::appendFaceted()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
- // test the part where its only using the QArray
- testFaceted(section, &builder);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::appendFacetedMap()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
- // now create a new section and fill to just below the threshold for QMap
- int t = section->mapThreshold();
- QVector3D testVertex(-12.34f, -23.45f, -34.56f);
- QVector3D incrVector(0.02, 0.02, 0.02);
- QVector3D testNormal(1.0f, 0.0f, 0.0f);
- for (int i = 0; i < (t - 2); ++i)
- {
- section->appendSmooth(QLogicalVertex(testVertex, testNormal));
- testVertex += incrVector;
- }
- testFaceted(section, &builder);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::accumNormals()
-{
- /*
- This mesh is a cap that could be the top of a sphere - its a central
- quad in the z = 1 plane, with x = 1, y = 1 as the bottom-left corner;
- with four more quads above, below, to the left and to the right, as
- viewed looking down the -ve z axis (plan view). The four quads around
- the central one join one one edge (in the z = 1 plane) and on the opp.
- edge slope down to the z = 0 plane. The four corners are filled in
- with triangles, so that the whole figure looks like an octagon in plan.
-
- plan view - x/y plane:
- ^ ----------
- | / | | \
- y / | | \
- /___|_____|____\
- | | | |
- | | | |
- |____|_____|_____|
- \ |* | /
- \ | | /
- \ | | /
- ---------- --> x
-
- side view - x/z plane:
- ________ z = 1
- / |* | \
- / | | \
- / | | \
- ----------------- z = 0
-
- The normals smoothing should make this as "round" as possible.
-
- Each quad of course, is actually divided from bottom-left to top-right
- into two triangles (not shown in the ascii art for clarity). The total
- number of triangles in the rendered result should be 14.
-
- At the vertex marked with the asterisk - #3 in the data below - there
- are 5 triangular faces contributing normals to the smoothed sum. The
- quad on the top has two co-planar triangles, and _each_ of those has
- a normal equal to (0, 0, 1) - only one of these should be summed.
- The other triangles are 1/2 of the two neighbouring quads - one has a
- normal of (-1, 0, 1) the other (0, -1, 1) - and the corner triangle
- which has a normal of (-1, -1, 1).
-
- The normalized sum of these is roughly (-0.4, -0.4, 0.8).
-
- If the normal from the extra triangle is erroneously included then
- the normalized sum is roughly (-0.35, -0.35, 0.87).
-
- The resulting normal is pulled more in the z-direction.
-
- In general if a a flat plane is broken up into a large number of
- triangles, they can bias the normal calculation. In a model often
- this can occur where triangulation algorithms produce degenerate
- solutions with many triangles converging on a point.
-
- This test is to cover this problem.
- */
- TestBuilder builder;
- builder.newSection(QGL::Smooth); // default - but making the point
- //QGLSection *section = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
- static float data[12*3] = {
- 1.0f, 0.0f, 0.0f,
- 2.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f,
- 1.0f, 1.0f, 1.0f,
- 2.0f, 1.0f, 1.0f,
- 3.0f, 1.0f, 0.0f,
- 0.0f, 2.0f, 0.0f,
- 1.0f, 2.0f, 1.0f,
- 2.0f, 2.0f, 1.0f,
- 3.0f, 2.0f, 0.0f,
- 1.0f, 3.0f, 0.0f,
- 2.0f, 3.0f, 0.0f
- };
- QVector3DArray v = QVector3DArray::fromRawData((const QVector3D *)data, 12);
- QGeometryData quads;
- quads.appendVertex(v[0], v[1], v[4], v[3]); // 0
- quads.appendVertex(v[2], v[3], v[7], v[6]); // 1
- quads.appendVertex(v[3], v[4], v[8], v[7]); // 2
- quads.appendVertex(v[4], v[5], v[9], v[8]); // 3
- quads.appendVertex(v[7], v[8], v[11], v[10]); // 4
- builder.addQuads(quads);
- QGeometryData triangles;
- triangles.appendVertex(v[0], v[3], v[2]); // 5
- triangles.appendVertex(v[1], v[5], v[4]); // 6
- triangles.appendVertex(v[6], v[7], v[10]); // 7
- triangles.appendVertex(v[8], v[9], v[11]); // 8
- builder.addTriangles(triangles);
- builder.finalizedSceneNode();
-
- // There are 9 faces as shown above - here are their normals
- QVector3DArray face_norms;
- face_norms.extend(9);
- face_norms[0] = QVector3D(0, -1, 1);
- face_norms[1] = QVector3D(-1, 0, 1);
- face_norms[2] = QVector3D(0, 0, 1);
- face_norms[3] = QVector3D(1, 0, 1);
- face_norms[4] = QVector3D(0, 1, 1);
- face_norms[5] = QVector3D(-1, -1, 1);
- face_norms[6] = QVector3D(1, -1, 1);
- face_norms[7] = QVector3D(-1, 1, 1);
- face_norms[8] = QVector3D(1, 1, 1);
- //for (int i = 0; i < 9; ++i)
- // face_norms[i].normalize();
-
- QVector3DArray expected;
- expected.extend(12);
- expected[0] = face_norms[0] + face_norms[5];
- expected[1] = face_norms[0] + face_norms[6];
- expected[4] = face_norms[1] + face_norms[5];
- expected[3] = face_norms[0] + face_norms[1] + face_norms[2] + face_norms[5];
- expected[2] = face_norms[0] + face_norms[2] + face_norms[3] + face_norms[6];
- expected[8] = face_norms[3] + face_norms[6];
- expected[6] = face_norms[1] + face_norms[7];
- expected[5] = face_norms[1] + face_norms[2] + face_norms[4] + face_norms[7];
- expected[7] = face_norms[2] + face_norms[3] + face_norms[4] + face_norms[8];
- expected[9] = face_norms[3] + face_norms[8];
- expected[11] = face_norms[4] + face_norms[7];
- expected[10] = face_norms[4] + face_norms[8];
- for (int i = 0; i < 12; ++i)
- expected[i].normalize();
-
- QGeometryData res = node->geometry();
- QCOMPARE(res.count(QGL::Position), 12);
- QCOMPARE(res.count(QGL::Normal), 12);
- QCOMPARE(res.indexCount(), 14 * 3);
- QCOMPARE(res.vertexAt(0), v[0]);
- QCOMPARE(res.vertexAt(4), v[2]);
- QCOMPARE(res.vertexAt(7), v[8]);
- QCOMPARE(res.vertexAt(11), v[10]);
- QCOMPARE(res.normalAt(0), expected.at(0));
- QCOMPARE(res.normalAt(1), expected.at(1));
- QCOMPARE(res.normalAt(2), expected.at(2));
- QCOMPARE(res.normalAt(3), expected.at(3));
- QCOMPARE(res.normalAt(4), expected.at(4));
- QCOMPARE(res.normalAt(5), expected.at(5));
- QCOMPARE(res.normalAt(6), expected.at(6));
- QCOMPARE(res.normalAt(7), expected.at(7));
- QCOMPARE(res.normalAt(8), expected.at(8));
- QCOMPARE(res.normalAt(9), expected.at(9));
- QCOMPARE(res.normalAt(10), expected.at(10));
- QCOMPARE(res.normalAt(11), expected.at(11));
-}
-
-void tst_QGLSection::normalizedNormals()
-{
- const qreal qRadius = 1.0f;
- const qreal qHeight = 0.6f;
- const qreal qThickness = 0.4f;
- const int qNumSlices = 16;
-
- TestBuilder builder;
- builder.newSection(QGL::Smooth); // default - but making the point
- //QGLSection *section = builder.currentSection();
- QGLSceneNode *node = builder.currentNode();
-
- // draw two 90 degree arcs, qThickness apart radially, and qHeight apart
- // in the z dimension. the points on the two arcs are joined into quads
- // but all the points on the high arc are joined to one single point in
- // the same z plane.
- QVector3D ap(qRadius, 0.0f, 0.0f);
- QVector3D bp(qRadius + qThickness, 0.0f, qHeight);
- QVector3D anc(qRadius * 2.0f, qRadius *2.0f, qHeight);
- for (int slice = 1; slice < qNumSlices; ++slice)
- {
- const qreal pi2 = 2.0 * M_PI;
- qreal angle = (slice * pi2) / (4 * qNumSlices);
- qreal cs = qCos(angle);
- qreal sn = qSin(angle);
- QVector3D a(cs * qRadius, sn * qRadius, 0.0f);
- QVector3D b(cs * (qRadius + qThickness), sn * (qRadius + qThickness), qHeight);
- QGeometryData quad;
- quad.appendVertex(ap, bp, b, a);
- builder.addQuads(quad);
- QGeometryData tri;
- tri.appendVertex(b, bp, anc);
- builder.addTriangles(tri);
- ap = a;
- bp = b;
- }
- builder.finalizedSceneNode();
- QGeometryData data = node->geometry();
- QVERIFY(!data.isNull());
- QCOMPARE(data.count(QGL::Position), 33);
-}
-
-void tst_QGLSection::testFaceted(QGLSection *section, QGLBuilder *builder)
-{
- int poffset = section->count(QGL::Position);
- int noffset = section->count(QGL::Normal);
-
- // append a vertex - check it appears in the data along with its normal
- QVector3D testVertex(1.234f, 2.345f, 3.456f);
- QVector3D testNormal(4.321f, 5.432f, 6.543f);
- section->appendFaceted(QLogicalVertex(testVertex, testNormal));
- QCOMPARE(section->vertices().count(), poffset + 1);
- QCOMPARE(section->vertices().at(poffset + 0), testVertex);
- QCOMPARE(section->normals().count(), noffset + 1);
- QCOMPARE(section->normals().at(noffset + 0), testNormal);
- QCOMPARE(section->indices().size(), poffset + 1);
- QCOMPARE_INDEX(section->indices()[poffset + 0], poffset + 0);
-
- // append a vertex equal to one already appended, but with different normal - check it was NOT coalesced
- QVector3D testNormal2(0.0f, 0.0f, 1.0f);
- section->appendFaceted(QLogicalVertex(testVertex, testNormal2));
- QCOMPARE(section->vertices().count(), poffset + 2);
- QCOMPARE(section->vertices().at(poffset + 1), testVertex);
- QCOMPARE(section->normals().count(), noffset + 2);
- QCOMPARE(section->normals().at(noffset + 1), testNormal2);
- QCOMPARE(section->indices().size(), poffset + 2);
- QCOMPARE_INDEX(section->indices()[poffset + 1], poffset + 1);
-
- // append a vertex equal to one already appended, but with same normal - check it WAS coalesced
- section->appendFaceted(QLogicalVertex(testVertex, testNormal2));
- QCOMPARE(section->vertices().count(), poffset + 2);
- QCOMPARE(section->vertices().at(poffset + 1), testVertex);
- QCOMPARE(section->normals().count(), noffset + 2);
- QCOMPARE(section->normals().at(noffset + 1), testNormal2);
- QCOMPARE(section->indices().size(), poffset + 3);
- QCOMPARE_INDEX(section->indices()[poffset + 2], poffset + 1);
-
- // append a vertex equal to one already appended, with same normal, BUT in a new section - check it was NOT coalesced
- section = new QGLSectionTest(builder);
- section->appendFaceted(QLogicalVertex(testVertex, testNormal2));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal2);
- QCOMPARE(section->indices().size(), 1);
- QCOMPARE_INDEX(section->indices()[0], 0);
-}
-
-void tst_QGLSection::appendTexCoord()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
-
- // note that the tests above do the case of texCoord, InvalidTexCoord
-
- // append a texture - check it appears in the data at the correct index
- QVector3D testVertex(1.234f, 2.345f, 3.456f);
- QVector3D testNormal(4.321f, 5.432f, 6.543f);
- QVector2D testTexCoord(0.0f, 0.0f);
- section->appendSmooth(QLogicalVertex(testVertex, testNormal, testTexCoord));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal);
- QCOMPARE(section->texCoords().count(), 1);
- QCOMPARE(section->texCoords().at(0), testTexCoord);
- QCOMPARE(section->indices().size(), 1);
- QCOMPARE_INDEX(section->indices()[0], 0);
-
- // append same texture - will coalesce and index the vert
- section->appendSmooth(QLogicalVertex(testVertex, testNormal, testTexCoord));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal);
- QCOMPARE(section->texCoords().count(), 1);
- QCOMPARE(section->texCoords().at(0), testTexCoord);
- QCOMPARE(section->indices().size(), 2);
- QCOMPARE_INDEX(section->indices()[1], 0);
-
- // new vertex created to carry the updated texture coord, even though
- // the normal and vertex are the same and thus the logical vert would
- // otherwise coalesced - the new vert is a copy (same vert and normal)
- QVector2D testTexCoord2(1.0, 1.0);
- section->appendSmooth(QLogicalVertex(testVertex, testNormal, testTexCoord2));
- QCOMPARE(section->vertices().count(), 2);
- QCOMPARE(section->vertices().at(1), testVertex);
- QCOMPARE(section->normals().count(), 2);
- QCOMPARE(section->normals().at(1), testNormal);
- QCOMPARE(section->texCoords().count(), 2);
- QCOMPARE(section->texCoords().at(1), testTexCoord2);
- QCOMPARE(section->indices().size(), 3);
- QCOMPARE_INDEX(section->indices()[2], 1);
-
- section = new QGLSectionTest(&builder);
-
- // append a faceted vertex with a tex coord check it appears in the data
- // in a new section now, so the same vert and normal wont be coalesced
- section->appendFaceted(QLogicalVertex(testVertex, testNormal, testTexCoord));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->normals().count(), 1);
- QCOMPARE(section->normals().at(0), testNormal);
- QCOMPARE(section->texCoords().count(), 1);
- QCOMPARE(section->texCoords().at(0), testTexCoord);
- QCOMPARE(section->indices().size(), 1);
- QCOMPARE_INDEX(section->indices()[0], 0);
-
- // append a vertex & normal equal to one already appended, but with different tex coord
- // check it was NOT coalesced, dup vert created
- section->appendFaceted(QLogicalVertex(testVertex, testNormal, testTexCoord2));
- QCOMPARE(section->vertices().count(), 2);
- QCOMPARE(section->vertices().at(1), testVertex);
- QCOMPARE(section->normals().count(), 2);
- QCOMPARE(section->normals().at(1), testNormal);
- QCOMPARE(section->texCoords().count(), 2);
- QCOMPARE(section->texCoords().at(1), testTexCoord2);
- QCOMPARE(section->indices().size(), 2);
- QCOMPARE_INDEX(section->indices()[1], 1);
-
- // append a vertex equal to first one appended above, with same normal, and
- // same texture - check it WAS coalesced to index 0
- section->appendFaceted(QLogicalVertex(testVertex, testNormal, testTexCoord));
- QCOMPARE(section->vertices().count(), 2);
- QCOMPARE(section->vertices().at(1), testVertex);
- QCOMPARE(section->normals().count(), 2);
- QCOMPARE(section->normals().at(1), testNormal);
- QCOMPARE(section->texCoords().count(), 2);
- QCOMPARE(section->texCoords().at(1), testTexCoord2);
- QCOMPARE(section->indices().size(), 3);
- QCOMPARE_INDEX(section->indices()[2], 0);
-
- QVERIFY(section->hasField(QGL::Normal));
- QVERIFY(section->hasField(QGL::TextureCoord0));
- QVERIFY(!section->hasField(QGL::Color));
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::appendColor()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
-
- QColor4ub color(32, 64, 128, 255);
- QVector3D testVertex(1.234f, 2.345f, 3.456f);
- section->append(QLogicalVertex(testVertex, color));
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->colors().count(), 1);
- QCOMPARE(section->colors().at(0), color);
-
- QVERIFY(section->hasField(QGL::Color));
- QVERIFY(!section->hasField(QGL::TextureCoord0));
- QVERIFY(!section->hasField(QGL::Normal));
-
- section = new QGLSectionTest(&builder);
-
- QVector2D testTexCoord(0.0f, 0.0f);
- QLogicalVertex lv;
- lv.setVertex(testVertex);
- lv.setColor(color);
- lv.setTexCoord(testTexCoord);
- section->append(lv);
- QCOMPARE(section->vertices().count(), 1);
- QCOMPARE(section->vertices().at(0), testVertex);
- QCOMPARE(section->colors().count(), 1);
- QCOMPARE(section->colors().at(0), color);
- QCOMPARE(section->texCoords().count(), 1);
- QCOMPARE(section->texCoords().at(0), testTexCoord);
-
- QVERIFY(section->hasField(QGL::Color));
- QVERIFY(section->hasField(QGL::TextureCoord0));
- QVERIFY(!section->hasField(QGL::Normal));
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-void tst_QGLSection::accessors()
-{
- TestBuilder builder;
- QGLSectionTest *section = new QGLSectionTest(&builder);
-
- QCOMPARE(section->smoothing(), QGL::Smooth);
-
- QGLSectionTest *section2 = new QGLSectionTest(&builder, QGL::Faceted);
- QCOMPARE(section2->smoothing(), QGL::Faceted);
-
- // suppress warning
- builder.finalizedSceneNode();
-}
-
-QTEST_APPLESS_MAIN(tst_QGLSection)
-
-#include "tst_qglsection.moc"
diff --git a/tests/auto/threed/qglsharedresource/qglsharedresource.pro b/tests/auto/threed/qglsharedresource/qglsharedresource.pro
deleted file mode 100644
index 4f1ed637..00000000
--- a/tests/auto/threed/qglsharedresource/qglsharedresource.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TARGET = tst_qglsharedresource
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d opengl widgets
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../src/threed/textures
-VPATH += ../../../../src/threed/textures
-
-HEADERS += qglsharedresource_p.h
-SOURCES += tst_qglsharedresource.cpp qglsharedresource.cpp
-QT+=widgets
diff --git a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp b/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp
deleted file mode 100644
index 44935059..00000000
--- a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglsharedresource_p.h"
-
-class tst_QGLSharedResource : public QObject
-{
-Q_OBJECT
-
-public:
- tst_QGLSharedResource() {}
- ~tst_QGLSharedResource() {}
-
-private slots:
- void resourceSharing();
-};
-
-static int dummyDestroyCount = 0;
-
-static void destroyDummyResource(GLuint id)
-{
- QVERIFY(id != 0);
- QVERIFY(QGLContext::currentContext() != 0);
- ++dummyDestroyCount;
-}
-
-void tst_QGLSharedResource::resourceSharing()
-{
- QSKIP("failing since refactor changes");
- dummyDestroyCount = 0;
-
- // Create a context.
- QGLWidget *glw1 = new QGLWidget();
- glw1->makeCurrent();
-
- // Nothing should be sharing with glw1's context yet.
- QVERIFY(!glw1->isSharing());
-
- // Create a guard for the first context.
- QGLSharedResource guard(destroyDummyResource);
- QVERIFY(guard.context() == 0);
- QVERIFY(guard.id() == 0);
- guard.attach(glw1->context(), 3);
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
-
- // Create another context that shares with the first.
- QVERIFY(!glw1->isSharing());
- QGLWidget *glw2 = new QGLWidget(0, glw1);
- if (!glw2->isSharing()) {
- delete glw2;
- delete glw1;
- QSKIP("Context sharing is not supported");
- }
- QVERIFY(glw1->isSharing());
- QVERIFY(glw1->context() != glw2->context());
-
- // Guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
-
- // Create some guards and then destroy them while the context is active.
- {
- QGLSharedResource guard2(destroyDummyResource);
- guard2.attach(glw1->context(), 4);
- QVERIFY(guard2.context() == glw1->context());
- QVERIFY(guard2.id() == 4);
- }
- QCOMPARE(dummyDestroyCount, 1);
- QGLSharedResource guard3(destroyDummyResource);
- guard3.attach(glw1->context(), 6);
- QVERIFY(guard3.context() == glw1->context());
- QVERIFY(guard3.id() == 6);
- guard3.destroy();
- QVERIFY(guard3.context() == 0);
- QVERIFY(guard3.id() == 0);
- QCOMPARE(dummyDestroyCount, 2);
-
- // Create a third context, not sharing with the others.
- QGLWidget *glw3 = new QGLWidget();
- QVERIFY(!glw3->isSharing());
-
- // Create a guard on the standalone context.
- QGLSharedResource guard4(destroyDummyResource);
- guard4.attach(glw3->context(), 5);
- QVERIFY(guard4.context() == glw3->context());
- QVERIFY(guard4.id() == 5);
-
- // Shared guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
-
- // Delete the first context.
- delete glw1;
-
- // The second context should no longer register as sharing.
- QVERIFY(!glw2->isSharing());
-
- // Shared guard should now be the second context, with the id the same.
- QVERIFY(guard.context() == glw2->context());
- QVERIFY(guard.id() == 3);
- QVERIFY(guard4.context() == glw3->context());
- QVERIFY(guard4.id() == 5);
-
- // Clean up the other contexts.
- delete glw2;
- delete glw3;
-
- // Guards should now be null and the id zero, but no extra calls to
- // the dummy destroy function.
- QVERIFY(guard.context() == 0);
- QVERIFY(guard.id() == 0);
- QVERIFY(guard4.context() == 0);
- QVERIFY(guard4.id() == 0);
- QCOMPARE(dummyDestroyCount, 2);
-}
-
-QTEST_MAIN(tst_QGLSharedResource)
-
-#include "tst_qglsharedresource.moc"
diff --git a/tests/auto/threed/qglsphere/qglsphere.pro b/tests/auto/threed/qglsphere/qglsphere.pro
deleted file mode 100644
index 71942cb3..00000000
--- a/tests/auto/threed/qglsphere/qglsphere.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TARGET = tst_qglsphere
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglsphere.cpp
diff --git a/tests/auto/threed/qglsphere/tst_qglsphere.cpp b/tests/auto/threed/qglsphere/tst_qglsphere.cpp
deleted file mode 100644
index 7aaaa3fe..00000000
--- a/tests/auto/threed/qglsphere/tst_qglsphere.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include "qglsphere.h"
-#include "qglbuilder.h"
-
-class tst_QGLSphere : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLSphere() {}
- ~tst_QGLSphere() {}
-
-private slots:
- void create();
- void modify();
- void build();
-
-private:
- bool validateSphere(QGLSceneNode *node, qreal size);
-};
-
-void tst_QGLSphere::create()
-{
- QGLSphere sphere1;
- QCOMPARE(sphere1.diameter(), qreal(1.0f));
- QCOMPARE(sphere1.subdivisionDepth(), 5);
-
- QGLSphere sphere2(27.5f);
- QCOMPARE(sphere2.diameter(), qreal(27.5f));
- QCOMPARE(sphere2.subdivisionDepth(), 5);
-
- QGLSphere sphere3(20.5f, 4);
- QCOMPARE(sphere3.diameter(), qreal(20.5f));
- QCOMPARE(sphere3.subdivisionDepth(), 4);
-}
-
-void tst_QGLSphere::modify()
-{
- QGLSphere sphere1;
- sphere1.setDiameter(5.0f);
- sphere1.setSubdivisionDepth(4);
- QCOMPARE(sphere1.diameter(), qreal(5.0f));
- QCOMPARE(sphere1.subdivisionDepth(), 4);
-}
-
-// Validates the geometry in a sphere node to check that all vertices
-// are on the surface of a sphere of diameter "size" and all normals
-// are of length 1 and point directly out from the center.
-bool tst_QGLSphere::validateSphere(QGLSceneNode *node, qreal size)
-{
- QGeometryData data = node->geometry();
- int start = node->start();
- int count = node->count();
- if (count <= 0)
- return false;
- QGL::IndexArray indices = data.indices();
- for (int index = 0; index < count; ++index) {
- QVector3D v = data.vertexAt(indices.at(index + start));
- QVector3D n = data.normalAt(indices.at(index + start));
- if (qAbs(n.length() - 1.0f) >= 0.0001)
- return false;
- QVector3D v2 = n * size / 2.0f;
- if (qAbs(v.x() - v2.x()) >= 0.0001 ||
- qAbs(v.y() - v2.y()) >= 0.0001 ||
- qAbs(v.z() - v2.z()) >= 0.0001)
- return false;
- }
- return true;
-}
-
-void tst_QGLSphere::build()
-{
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- QGLSceneNode *node1 = builder.newNode();
- builder << QGLSphere(5.0f, 5);
- QGLSceneNode *root = builder.finalizedSceneNode();
- QVERIFY(validateSphere(node1, 5.0f));
- delete root;
-}
-
-QTEST_APPLESS_MAIN(tst_QGLSphere)
-
-#include "tst_qglsphere.moc"
diff --git a/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro b/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro
deleted file mode 100644
index a3e566c9..00000000
--- a/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TARGET = tst_qglvertexbundle
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d opengl widgets
-CONFIG += warn_on
-
-SOURCES += tst_qglvertexbundle.cpp
-QT+=widgets
diff --git a/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp b/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp
deleted file mode 100644
index 91633a64..00000000
--- a/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qglvertexbundle.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include "qvector4darray.h"
-#include "qcolor4ub.h"
-
-class tst_QGLVertexBundle : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLVertexBundle() {}
- ~tst_QGLVertexBundle() {}
-
-private slots:
- void interleaved();
- void singleAttribute();
- void large();
- void otherAttributes();
-};
-
-void tst_QGLVertexBundle::interleaved()
-{
- QSKIP("QWidget: Cannot create a QWidget when no GUI is being used");
- // Interleave 4 positions and texture co-ordinates, which will
- // result in the numbers 1..20 ending up in the GL server's buffer.
- QVector3DArray positions;
- positions.append(1.0f, 2.0f, 3.0f);
- positions.append(6.0f, 7.0f, 8.0f);
- positions.append(11.0f, 12.0f, 13.0f);
- positions.append(16.0f, 17.0f, 18.0f);
-
- QVector2DArray texCoords;
- texCoords.append(4.0f, 5.0f);
- texCoords.append(9.0f, 10.0f);
- texCoords.append(14.0f, 15.0f);
- texCoords.append(19.0f, 20.0f);
-
- QGLVertexBundle bundle;
-
- // Cannot upload an empty bundle.
- QVERIFY(!bundle.upload());
-
- QVERIFY(bundle.attributes().isEmpty());
-
- bundle.addAttribute(QGL::Position, positions);
- bundle.addAttribute(QGL::TextureCoord0, texCoords);
-
- QGLAttributeSet set = bundle.attributes();
- QVERIFY(set.contains(QGL::Position));
- QVERIFY(set.contains(QGL::TextureCoord0));
- QVERIFY(!set.contains(QGL::TextureCoord1));
-
- QVERIFY(!bundle.isUploaded());
- QCOMPARE(bundle.vertexCount(), 4);
-
- // Create a context to upload into. We populate the QGLVertexBundle
- // with data before doing this to ensure that the client-side part of
- // the buffers can be created at application startup time before an
- // actual OpenGL context exists.
- QGLWidget glw;
- glw.makeCurrent();
-
- // Upload the bundle and bail out if we couldn't upload it
- // (i.e. vertex buffers are not supported in the GL server).
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QVERIFY(bundle.isUploaded());
-
- // Uploading again should do nothing - just succeed.
- QVERIFY(bundle.upload());
-
- // Verify the contents of the buffer in the GL server if we can map it.
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 20));
- float *mapped = reinterpret_cast<float *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapped) {
- for (int index = 0; index < 20; ++index)
- QCOMPARE(mapped[index], float(index + 1));
- }
- bundle.release();
-
- // Make copies of the bundle, to test ref-counting.
- QGLVertexBundle bundle2(bundle);
- QGLVertexBundle bundle3;
- QCOMPARE(bundle2.buffer().bufferId(), bundle.buffer().bufferId());
- QVERIFY(!bundle3.buffer().bufferId());
- bundle3 = bundle;
- QCOMPARE(bundle3.buffer().bufferId(), bundle.buffer().bufferId());
-}
-
-// Single attribute uploads take a quicker path, which this function tests.
-void tst_QGLVertexBundle::singleAttribute()
-{
- QVector3DArray positions;
- positions.append(1.0f, 2.0f, 3.0f);
- positions.append(4.0f, 5.0f, 6.0f);
- positions.append(7.0f, 8.0f, 9.0f);
- positions.append(10.0f, 11.0f, 12.0f);
-
- QGLVertexBundle bundle;
- bundle.addAttribute(QGL::Position, positions);
-
- QVERIFY(!bundle.isUploaded());
- QCOMPARE(bundle.vertexCount(), 4);
-
- QGLWidget glw;
- glw.makeCurrent();
-
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QVERIFY(bundle.isUploaded());
-
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 12));
- float *mapped = reinterpret_cast<float *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapped) {
- for (int index = 0; index < 12; ++index)
- QCOMPARE(mapped[index], float(index + 1));
- }
- bundle.release();
-}
-
-void tst_QGLVertexBundle::large()
-{
- QVector3DArray positions;
- QVector2DArray texCoords;
- for (int index = 0; index < 2048; ++index) {
- positions.append(index * 5, index * 5 + 1, index * 5 + 2);
- texCoords.append(index * 5 + 3, index * 5 + 4);
- }
- QGLWidget glw;
- glw.makeCurrent();
- QGLVertexBundle bundle;
- bundle.addAttribute(QGL::Position, positions);
- bundle.addAttribute(QGL::TextureCoord0, texCoords);
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QCOMPARE(bundle.vertexCount(), 2048);
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 2048 * 5));
- float *mapped = reinterpret_cast<float *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapped) {
- for (int index = 0; index < 2048 * 5; ++index)
- QCOMPARE(mapped[index], float(index));
- }
- bundle.release();
-}
-
-void tst_QGLVertexBundle::otherAttributes()
-{
- QVector4DArray positions;
- positions.append(1.0f, 2.0f, 3.0f, 4.0f);
- positions.append(6.0f, 7.0f, 8.0f, 9.0f);
- positions.append(11.0f, 12.0f, 13.0f, 14.0f);
- positions.append(16.0f, 17.0f, 18.0f, 19.0f);
-
- QArray<float> texCoords;
- texCoords.append(5.0f);
- texCoords.append(10.0f);
- texCoords.append(15.0f);
- texCoords.append(20.0f);
-
- QGLWidget glw;
- glw.makeCurrent();
-
- QGLVertexBundle bundle;
- bundle.addAttribute(QGL::Position, positions);
- bundle.addAttribute(QGL::TextureCoord0, texCoords);
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QCOMPARE(bundle.vertexCount(), 4);
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 20));
- float *mapped = reinterpret_cast<float *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapped) {
- for (int index = 0; index < 20; ++index)
- QCOMPARE(mapped[index], float(index + 1));
- }
- bundle.release();
-
- bundle = QGLVertexBundle();
- QVERIFY(!bundle.isUploaded());
-
- QArray<QColor4ub> colors;
- for (int index = 0; index < 64; ++index) {
- colors.append(QColor4ub(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
- bundle.addAttribute(QGL::Color, colors);
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QCOMPARE(bundle.vertexCount(), 64);
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(uchar) * 256));
- uchar *mapuchar = reinterpret_cast<uchar *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapuchar) {
- for (int index = 0; index < 256; ++index)
- QCOMPARE(mapuchar[index], uchar(index));
- }
- bundle.release();
-
- bundle = QGLVertexBundle();
- QVERIFY(!bundle.isUploaded());
-
- QCustomDataArray custom(texCoords);
- bundle.addAttribute(QGL::TextureCoord1, custom);
- if (!bundle.upload()) {
- QVERIFY(!bundle.isUploaded());
- return;
- }
- QCOMPARE(bundle.vertexCount(), 4);
- QVERIFY(bundle.bind());
- QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 4));
- mapped = reinterpret_cast<float *>
- (bundle.buffer().map(QGLBuffer::ReadOnly));
- if (mapped) {
- for (int index = 0; index < 4; ++index)
- QCOMPARE(mapped[index], float((index + 1) * 5));
- }
- bundle.release();
-}
-
-QTEST_MAIN(tst_QGLVertexBundle)
-
-#include "tst_qglvertexbundle.moc"
diff --git a/tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro b/tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro
deleted file mode 100644
index 0d429397..00000000
--- a/tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qgraphicstransform3d
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qgraphicstransform3d.cpp
diff --git a/tests/auto/threed/qgraphicstransform3d/tst_qgraphicstransform3d.cpp b/tests/auto/threed/qgraphicstransform3d/tst_qgraphicstransform3d.cpp
deleted file mode 100644
index 2f42a202..00000000
--- a/tests/auto/threed/qgraphicstransform3d/tst_qgraphicstransform3d.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qgraphicsrotation3d.h"
-#include "qgraphicsscale3d.h"
-#include "qgraphicstranslation3d.h"
-#include "qgraphicsbillboardtransform.h"
-
-class tst_QGraphicsTransform3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QGraphicsTransform3D() {}
- ~tst_QGraphicsTransform3D() {}
-
-private slots:
- void rotation3D();
- void scale3D();
- void translation3D();
- void billboard();
-};
-
-static bool isSameMatrix(const QMatrix4x4 &m1, const QMatrix4x4 &m2)
-{
- for (int row = 0; row < 4; ++row) {
- for (int col = 0; col < 4; ++col) {
- if (!qFuzzyIsNull(float(m1(row, col) - m2(row, col))))
- return false;
- }
- }
- return true;
-}
-
-void tst_QGraphicsTransform3D::rotation3D()
-{
- QGraphicsRotation3D rot1;
- QVERIFY(rot1.origin() == QVector3D(0, 0, 0));
- QVERIFY(rot1.axis() == QVector3D(0, 0, 1));
- QCOMPARE(rot1.angle(), qreal(0.0f));
-
- QSignalSpy spy1(&rot1, SIGNAL(originChanged()));
- QSignalSpy spy2(&rot1, SIGNAL(axisChanged()));
- QSignalSpy spy3(&rot1, SIGNAL(angleChanged()));
- QSignalSpy spy4(&rot1, SIGNAL(transformChanged()));
-
- rot1.setOrigin(QVector3D(1, 2, 3));
- rot1.setAxis(QVector3D(4, -5, 6));
- rot1.setAngle(45.0f);
- QVERIFY(rot1.origin() == QVector3D(1, 2, 3));
- QVERIFY(rot1.axis() == QVector3D(4, -5, 6));
- QCOMPARE(rot1.angle(), qreal(45.0f));
-
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 1);
- QCOMPARE(spy4.size(), 3);
-
- // Change to same values should not result in any extra signals.
- rot1.setOrigin(QVector3D(1, 2, 3));
- rot1.setAxis(QVector3D(4, -5, 6));
- rot1.setAngle(45.0f);
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 1);
- QCOMPARE(spy4.size(), 3);
-
- QMatrix4x4 m1;
- rot1.applyTo(&m1);
-
- QMatrix4x4 m2;
- m2.translate(1, 2, 3);
- m2.rotate(45.0f, QVector3D(4, -5, 6));
- m2.translate(-1, -2, -3);
- QVERIFY(isSameMatrix(m1, m2));
-
- QGraphicsRotation3D *rot2 = qobject_cast<QGraphicsRotation3D *>
- (rot1.clone(this));
- QVERIFY(rot2 != 0);
- QVERIFY(rot2 != &rot1);
- QVERIFY(rot2->parent() == this);
- QVERIFY(rot2->origin() == rot1.origin());
- QVERIFY(rot2->axis() == rot1.axis());
- QVERIFY(rot2->angle() == rot1.angle());
- delete rot2;
-}
-
-void tst_QGraphicsTransform3D::scale3D()
-{
- QGraphicsScale3D scale1;
- QVERIFY(scale1.origin() == QVector3D(0, 0, 0));
- QVERIFY(scale1.scale() == QVector3D(1, 1, 1));
-
- QSignalSpy spy1(&scale1, SIGNAL(originChanged()));
- QSignalSpy spy2(&scale1, SIGNAL(scaleChanged()));
- QSignalSpy spy3(&scale1, SIGNAL(transformChanged()));
-
- scale1.setOrigin(QVector3D(1, 2, 3));
- scale1.setScale(QVector3D(4, -6, 0.5f));
- QVERIFY(scale1.origin() == QVector3D(1, 2, 3));
- QVERIFY(scale1.scale() == QVector3D(4, -6, 0.5f));
-
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 2);
-
- // Change to same values should not result in any extra signals.
- scale1.setOrigin(QVector3D(1, 2, 3));
- scale1.setScale(QVector3D(4, -6, 0.5f));
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 2);
-
- QMatrix4x4 m1;
- scale1.applyTo(&m1);
-
- QMatrix4x4 m2;
- m2.translate(1, 2, 3);
- m2.scale(QVector3D(4, -6, 0.5f));
- m2.translate(-1, -2, -3);
- QVERIFY(isSameMatrix(m1, m2));
-
- scale1.setScale(QVector3D(20, -4, 42));
- QCOMPARE(spy2.size(), 2);
- QCOMPARE(spy3.size(), 3);
-
- QVERIFY(scale1.scale() == QVector3D(20, -4, 42));
-
- QVERIFY(scale1.origin() == QVector3D(1, 2, 3));
- QCOMPARE(spy1.size(), 1);
-
- QGraphicsScale3D *scale2 = qobject_cast<QGraphicsScale3D *>
- (scale1.clone(this));
- QVERIFY(scale2 != 0);
- QVERIFY(scale2 != &scale1);
- QVERIFY(scale2->parent() == this);
- QVERIFY(scale2->origin() == scale1.origin());
- QVERIFY(scale2->scale() == scale1.scale());
- delete scale2;
-}
-
-void tst_QGraphicsTransform3D::translation3D()
-{
- QGraphicsTranslation3D translate1;
- QVERIFY(translate1.translate() == QVector3D(0, 0, 0));
- QCOMPARE(translate1.progress(), qreal(1.0f));
-
- QSignalSpy spy1(&translate1, SIGNAL(translateChanged()));
- QSignalSpy spy2(&translate1, SIGNAL(progressChanged()));
- QSignalSpy spy3(&translate1, SIGNAL(transformChanged()));
-
- translate1.setTranslate(QVector3D(4, -6, 0.5f));
- translate1.setProgress(2.0f);
- QVERIFY(translate1.translate() == QVector3D(4, -6, 0.5f));
- QCOMPARE(translate1.progress(), qreal(2.0f));
-
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 2);
-
- // Change to same values should not result in any extra signals.
- translate1.setTranslate(QVector3D(4, -6, 0.5f));
- translate1.setProgress(2.0f);
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
- QCOMPARE(spy3.size(), 2);
-
- QMatrix4x4 m1;
- translate1.applyTo(&m1);
-
- QMatrix4x4 m2;
- m2.translate(QVector3D(8, -12, 1));
- QVERIFY(isSameMatrix(m1, m2));
-
- QGraphicsTranslation3D *translate2 = qobject_cast<QGraphicsTranslation3D *>
- (translate1.clone(this));
- QVERIFY(translate2 != 0);
- QVERIFY(translate2 != &translate1);
- QVERIFY(translate2->parent() == this);
- QVERIFY(translate2->translate() == translate1.translate());
- QVERIFY(translate2->progress() == translate1.progress());
- delete translate2;
-}
-
-void tst_QGraphicsTransform3D::billboard()
-{
- QGraphicsBillboardTransform billboard1;
- QVERIFY(!billboard1.preserveUpVector());
-
- QSignalSpy spy1(&billboard1, SIGNAL(preserveUpVectorChanged()));
- QSignalSpy spy2(&billboard1, SIGNAL(transformChanged()));
-
- billboard1.setPreserveUpVector(true);
- QVERIFY(billboard1.preserveUpVector());
-
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
-
- // Change to same value should not result in any extra signals.
- billboard1.setPreserveUpVector(true);
- QCOMPARE(spy1.size(), 1);
- QCOMPARE(spy2.size(), 1);
-
- QMatrix4x4 m1;
- billboard1.applyTo(&m1);
- QVERIFY(m1.isIdentity());
-
- QMatrix4x4 m2(2.0f, 3.0f, 4.0f, 5.0f,
- 6.0f, 7.0f, 8.0f, 9.0f,
- 10.0f, 11.0f, 12.0f, 13.0f,
- 14.0f, 15.0f, 16.0f, 17.0f);
- QMatrix4x4 m3(1.0f, 0.0f, 0.0f, 5.0f,
- 0.0f, 1.0f, 0.0f, 9.0f,
- 0.0f, 0.0f, 1.0f, 13.0f,
- 14.0f, 15.0f, 16.0f, 17.0f);
- QMatrix4x4 m4(1.0f, 3.0f, 0.0f, 5.0f,
- 0.0f, 7.0f, 0.0f, 9.0f,
- 0.0f, 11.0f, 1.0f, 13.0f,
- 14.0f, 15.0f, 16.0f, 17.0f);
-
- QMatrix4x4 m5(m2);
- billboard1.setPreserveUpVector(false);
- billboard1.applyTo(&m5);
- QVERIFY(m5 == m3);
-
- QMatrix4x4 m6(m2);
- billboard1.setPreserveUpVector(true);
- billboard1.applyTo(&m6);
- QVERIFY(m6 == m4);
-
- QGraphicsBillboardTransform *billboard2 = qobject_cast<QGraphicsBillboardTransform *>
- (billboard1.clone(this));
- QVERIFY(billboard2 != 0);
- QVERIFY(billboard2 != &billboard1);
- QVERIFY(billboard2->parent() == this);
- QVERIFY(billboard2->preserveUpVector() == billboard1.preserveUpVector());
- delete billboard2;
-}
-
-QTEST_APPLESS_MAIN(tst_QGraphicsTransform3D)
-
-#include "tst_qgraphicstransform3d.moc"
diff --git a/tests/auto/threed/qplane3d/qplane3d.pro b/tests/auto/threed/qplane3d/qplane3d.pro
deleted file mode 100644
index c8dbfb1b..00000000
--- a/tests/auto/threed/qplane3d/qplane3d.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qplane3d
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qplane3d.cpp
diff --git a/tests/auto/threed/qplane3d/tst_qplane3d.cpp b/tests/auto/threed/qplane3d/tst_qplane3d.cpp
deleted file mode 100644
index 17f14164..00000000
--- a/tests/auto/threed/qplane3d/tst_qplane3d.cpp
+++ /dev/null
@@ -1,450 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-
-#include "qplane3d.h"
-#include "qray3d.h"
-
-class tst_QPlane3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QPlane3D() {}
- ~tst_QPlane3D() {}
-
-private slots:
- void create_data();
- void create();
- void intersection_data();
- void intersection();
- void noIntersection_data();
- void noIntersection();
- void contains_data();
- void contains();
- void distanceTo_data();
- void distanceTo();
- void compare();
- void transform_data();
- void transform();
- void dataStream();
- void properties();
- void metaTypes();
-};
-
-// since all calculations involved QVector3D are producing values with only
-// float precision those calculations can at best be float precision
-// if you assign the results of the calculation to a qreal then qFuzzyCompare
-// will quite happily use a much higher standard of precision than it is
-// possible to acheive - hence redefine it here to always use the float
-// Also while on the job fix the problem where a compared value happens
-// to be zero (and you cannot always predict this, and should not predict it
-// since then you produce self-fulling prophecies instead of tests).
-// In that case qFuzzyCompare has a completely strict criterion since
-// it finds the "fudge factor" by multiplying by zero...
-static inline bool fuzzyCompare(qreal p1, qreal p2)
-{
- float fac = qMin(qAbs(p1), qAbs(p2));
- return (qAbs(p1 - p2) <= (qIsNull(fac) ? 0.00001f : 0.00001f * fac));
-}
-
-static inline bool fuzzyCompare(const QVector3D &lhs, const QVector3D &rhs)
-{
- if (fuzzyCompare(lhs.x(), rhs.x()) &&
- fuzzyCompare(lhs.y(), rhs.y()) &&
- fuzzyCompare(lhs.z(), rhs.z()))
- return true;
-#ifndef QT_NO_DEBUG_STREAM
- qWarning() << "actual:" << lhs;
- qWarning() << "expected:" << rhs;
-#endif
- return false;
-}
-
-static inline bool fuzzyIsNull(const QVector3D &v)
-{
- return fuzzyCompare(v.x(), 0.0f) &&
- fuzzyCompare(v.y(), 0.0f) &&
- fuzzyCompare(v.z(), 0.0f);
-}
-
-void tst_QPlane3D::create_data()
-{
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<QVector3D>("normal");
-
- // normalized vectors for the normals.
- QTest::newRow("line on x-axis from origin")
- << QVector3D()
- << QVector3D(1.0f, 0.0f, 0.0f);
-
- QTest::newRow("line paralell -z-axis from 3,3,3")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -1.0f);
-
- QTest::newRow("vertical line (paralell to y-axis)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 1.0f, 0.0f);
-
- QTest::newRow("equidistant from all 3 axes")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.57735026919f, 0.57735026919f, 0.57735026919f);
-
- // Unnormalized vectors for the normals.
- QTest::newRow("line on x-axis from origin")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f);
-
- QTest::newRow("line paralell -z-axis from 3,3,3")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f);
-
- QTest::newRow("vertical line (paralell to y-axis)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 5.3f, 0.0f);
-
- QTest::newRow("equidistant from all 3 axes")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(1.0f, 1.0f, 1.0f);
-
- QTest::newRow("negative direction")
- << QVector3D(-3.0f, -3.0f, -3.0f)
- << QVector3D(-1.2f, -1.8f, -2.4f);
-}
-
-void tst_QPlane3D::create()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, normal);
- QPlane3D plane(point, normal);
- QVERIFY(fuzzyCompare(plane.normal(), normal));
- QVERIFY(fuzzyCompare(plane.origin(), point));
-
- QPlane3D plane2;
- QVERIFY(plane2.origin() == QVector3D(0, 0, 0));
- QVERIFY(plane2.normal() == QVector3D(1, 0, 0));
- plane2.setOrigin(point);
- plane2.setNormal(normal);
- QVERIFY(fuzzyCompare(plane2.normal(), normal));
- QVERIFY(fuzzyCompare(plane2.origin(), point));
-}
-
-void tst_QPlane3D::intersection_data()
-{
- // Line
- QTest::addColumn<QVector3D>("point1");
- QTest::addColumn<QVector3D>("direction");
-
- // Plane
- QTest::addColumn<QVector3D>("point2");
- QTest::addColumn<QVector3D>("normal");
-
- // Resulting intersection
- QTest::addColumn<QVector3D>("intersection");
-
- // These direction vectors will get normalized
- QTest::newRow("line on x-axis, plane in z-y")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f)
- << QVector3D(4.0f, 1.0f, 1.0f)
- << QVector3D(1.0f, 0.0f, 0.0f)
- << QVector3D(4.0f, 0.0f, 0.0f);
-
- QTest::newRow("line -z-axis, plane in x-y")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f)
- << QVector3D(1.0f, 1.0f, -2.4f)
- << QVector3D(0.0f, 0.0f, -1.0f)
- << QVector3D(3.0f, 3.0f, -2.4f);
-
- QTest::newRow("line y-axis, plane in x-z")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 5.3f, 0.0f)
- << QVector3D(1.5f, 0.6f, 1.5f)
- << QVector3D(0.0f, -7.2f, 0.0f)
- << QVector3D(0.5f, 0.6f, 0.5f);
-
- QTest::newRow("line equidistant from axes, plane in y-z")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(1.0f, 1.0f, 1.0f)
- << QVector3D(5.0f, 3.0f, 3.0f)
- << QVector3D(1.0f, 1.0f, 1.0f)
- << QVector3D(3.8333332539f, 3.3333332539f, 3.8333332539f);
-
- QTest::newRow("negative direction")
- << QVector3D(-3.0f, -3.0f, -3.0f)
- << QVector3D(-1.2f, -1.8f, -2.4f)
- << QVector3D(5.0f, 3.0f, 3.0f)
- << QVector3D(1.0f, 1.0f, 1.0f)
- << QVector3D( 1.4444446564f, 3.6666665077f, 5.8888893127f);
-}
-
-void tst_QPlane3D::intersection()
-{
- QFETCH(QVector3D, point1);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point2);
- QFETCH(QVector3D, normal);
- QFETCH(QVector3D, intersection);
-
- QRay3D line(point1, direction);
- QPlane3D plane(point2, normal);
-
- qreal t = plane.intersection(line);
- QVERIFY(!qIsNaN(t));
- QVERIFY(fuzzyCompare(line.point(t), intersection));
- QVERIFY(plane.intersects(line));
-}
-
-void tst_QPlane3D::noIntersection_data()
-{
- QTest::addColumn<QVector3D>("point1");
- QTest::addColumn<QVector3D>("normal");
- QTest::addColumn<QVector3D>("point2");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("intersection");
-
- // These direction vectors will get normalized
- QTest::newRow("line on x-axis, plane in z-x")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f)
- << QVector3D(4.0f, 1.0f, 1.0f)
- << QVector3D(0.0f, 1.0f, 0.0f);
-
- QTest::newRow("line -z-axis, lies on plane in z-x")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f)
- << QVector3D(1.0f, 3.0f, 1.0f)
- << QVector3D(0.0f, -0.7f, 0.0f);
-
- QTest::newRow("line on an angle, never meets plane on angle")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.1f, 0.0f, 0.0f)
- << QVector3D(1.0f, 1.0f, 3.0f)
- << QVector3D(0.0f, 1.0f, 0.0f);
-}
-
-void tst_QPlane3D::noIntersection()
-{
- QFETCH(QVector3D, point1);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point2);
- QFETCH(QVector3D, normal);
-
- QPlane3D plane(point1, normal);
- QRay3D line(point2, direction);
-
- qreal t = plane.intersection(line);
- QVERIFY(qIsNaN(t));
- QVERIFY(!plane.intersects(line));
-}
-
-// Find a vector that lies perpendicular to the normal, and in the plane.
-static QVector3D vectorInPlane(const QPlane3D &plane)
-{
- QVector3D v = QVector3D::crossProduct(plane.normal(), QVector3D(1, 0, 0));
- if (fuzzyIsNull(v))
- v = QVector3D::crossProduct(plane.normal(), QVector3D(0, 1, 0));
- if (fuzzyIsNull(v))
- v = QVector3D::crossProduct(plane.normal(), QVector3D(0, 0, 1));
- v = QVector3D::dotProduct(v, plane.normal()) * plane.normal() /
- plane.normal().lengthSquared();
- Q_ASSERT(fuzzyCompare(QVector3D::dotProduct(v, plane.normal()), 0.0f));
- return v;
-}
-
-void tst_QPlane3D::contains_data()
-{
- create_data();
-}
-
-void tst_QPlane3D::contains()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, normal);
- QPlane3D plane(point, normal);
-
- QVERIFY(plane.contains(point));
- QVERIFY(!plane.contains(point + normal));
- QVERIFY(!plane.contains(point - normal));
-
- QVector3D v = vectorInPlane(plane);
- QVERIFY(plane.contains(QRay3D(point, v)));
- QVERIFY(plane.contains(QRay3D(point - v, v)));
- QVERIFY(!plane.contains(QRay3D(point + normal, v)));
- QVERIFY(!plane.contains(QRay3D(point, normal)));
-}
-
-void tst_QPlane3D::distanceTo_data()
-{
- create_data();
-}
-
-void tst_QPlane3D::distanceTo()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, normal);
- QPlane3D plane(point, normal);
-
- QVERIFY(fuzzyCompare(plane.distanceTo(point), 0.0f));
- QVERIFY(fuzzyCompare(plane.distanceTo(point + normal), normal.length()));
- QVERIFY(fuzzyCompare(plane.distanceTo(point - normal), -normal.length()));
-
- QVector3D v = vectorInPlane(plane);
- QVERIFY(fuzzyCompare(plane.distanceTo(point + v), 0.0f));
- QVERIFY(fuzzyCompare(plane.distanceTo(point + normal + v), normal.length()));
- QVERIFY(fuzzyCompare(plane.distanceTo(point - normal + v), -normal.length()));
-}
-
-void tst_QPlane3D::compare()
-{
- QPlane3D plane1(QVector3D(10, 20, 30), QVector3D(-1, 2, 4));
- QPlane3D plane2(QVector3D(10, 20, 30), QVector3D(1, -2, -4));
- QPlane3D plane3(QVector3D(0, 20, 30), QVector3D(-1, 2, 4));
- QVERIFY(plane1 == plane1);
- QVERIFY(!(plane1 != plane1));
- QVERIFY(qFuzzyCompare(plane1, plane1));
- QVERIFY(plane1 != plane2);
- QVERIFY(!(plane1 == plane2));
- QVERIFY(!qFuzzyCompare(plane1, plane2));
- QVERIFY(plane1 != plane3);
- QVERIFY(!(plane1 == plane3));
- QVERIFY(!qFuzzyCompare(plane1, plane3));
-}
-
-void tst_QPlane3D::transform_data()
-{
- create_data();
-}
-
-void tst_QPlane3D::transform()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, normal);
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QPlane3D plane1(point, normal);
- QPlane3D plane2(plane1);
- QPlane3D plane3;
-
- plane1.transform(m);
- plane3 = plane2.transformed(m);
-
- QVERIFY(fuzzyCompare(plane1.origin(), plane3.origin()));
- QVERIFY(fuzzyCompare(plane1.normal(), plane3.normal()));
-
- QVERIFY(fuzzyCompare(plane1.origin(), m * point));
- QVERIFY(fuzzyCompare(plane1.normal(), m.mapVector(normal)));
-}
-
-void tst_QPlane3D::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QPlane3D plane(QVector3D(1.0f, 2.0f, 3.0f),
- QVector3D(4.0f, 5.0f, 6.0f));
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << plane;
- }
-
- QPlane3D plane2;
- {
- QDataStream stream2(data);
- stream2 >> plane2;
- }
-
- QVERIFY(plane == plane2);
-#endif
-}
-
-class tst_QPlane3DProperties : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QPlane3D plane READ plane WRITE setPlane)
-public:
- tst_QPlane3DProperties(QObject *parent = 0) : QObject(parent) {}
-
- QPlane3D plane() const { return p; }
- void setPlane(const QPlane3D& value) { p = value; }
-
-private:
- QPlane3D p;
-};
-
-// Test getting and setting properties via the metaobject system.
-void tst_QPlane3D::properties()
-{
- tst_QPlane3DProperties obj;
-
- qRegisterMetaType<QPlane3D>();
-
- obj.setPlane(QPlane3D(QVector3D(1, 2, 3), QVector3D(4, 5, 6)));
-
- QPlane3D p = qVariantValue<QPlane3D>(obj.property("plane"));
- QCOMPARE(p.origin(), QVector3D(1, 2, 3));
- QCOMPARE(p.normal(), QVector3D(4, 5, 6));
-
- obj.setProperty("plane",
- qVariantFromValue
- (QPlane3D(QVector3D(-1, -2, -3), QVector3D(-4, -5, -6))));
-
- p = qVariantValue<QPlane3D>(obj.property("plane"));
- QCOMPARE(p.origin(), QVector3D(-1, -2, -3));
- QCOMPARE(p.normal(), QVector3D(-4, -5, -6));
-}
-
-void tst_QPlane3D::metaTypes()
-{
- int id = qMetaTypeId<QPlane3D>();
- QVERIFY(QMetaType::type("QPlane3D") == id);
- QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("QPlane3D"));
- QVERIFY(QMetaType::isRegistered(id));
-}
-
-QTEST_APPLESS_MAIN(tst_QPlane3D)
-
-#include "tst_qplane3d.moc"
diff --git a/tests/auto/threed/qray3d/qray3d.pro b/tests/auto/threed/qray3d/qray3d.pro
deleted file mode 100644
index 1dc89415..00000000
--- a/tests/auto/threed/qray3d/qray3d.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TARGET = tst_qray3d
-CONFIG += testcase
-TEMPLATE = app
-QT += testlib qt3d
-CONFIG += warn_on
-SOURCES += tst_qray3d.cpp
diff --git a/tests/auto/threed/qray3d/tst_qray3d.cpp b/tests/auto/threed/qray3d/tst_qray3d.cpp
deleted file mode 100644
index 97263c99..00000000
--- a/tests/auto/threed/qray3d/tst_qray3d.cpp
+++ /dev/null
@@ -1,540 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qray3d.h"
-#include "../../../shared/qtest_helpers.h"
-
-class tst_QRay3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QRay3D() {}
- ~tst_QRay3D() {}
-
-private slots:
- void create_data();
- void create();
- void projection_data();
- void projection();
- void point_data();
- void point();
- void contains_point_data();
- void contains_point();
- void contains_ray_data();
- void contains_ray();
- void distanceTo_data();
- void distanceTo();
- void compare();
- void dataStream();
- void transform_data();
- void transform();
- void properties();
- void metaTypes();
-};
-
-// since all calculations involved QVector3D are producing values with only
-// float precision those calculations can at best be float precision
-// if you assign the results of the calculation to a qreal then qFuzzyCompare
-// will quite happily use a much higher standard of precision than it is
-// possible to acheive - hence redefine it here to always use the float
-// Also while on the job fix the problem where a compared value happens
-// to be zero (and you cannot always predict this, and should not predict it
-// since then you produce self-fulling prophecies instead of tests).
-// In that case qFuzzyCompare has a completely strict criterion since
-// it finds the "fudge factor" by multiplying by zero...
-static inline bool fuzzyCompare(qreal p1, qreal p2)
-{
- float fac = qMin(qAbs(p1), qAbs(p2));
- return (qAbs(p1 - p2) <= (qIsNull(fac) ? 0.00001f : 0.00001f * fac));
-}
-
-static inline bool fuzzyCompare(const QVector3D &lhs, const QVector3D &rhs)
-{
- if (fuzzyCompare(lhs.x(), rhs.x()) &&
- fuzzyCompare(lhs.y(), rhs.y()) &&
- fuzzyCompare(lhs.z(), rhs.z()))
- return true;
-#ifndef QT_NO_DEBUG_STREAM
- qWarning() << "actual:" << lhs;
- qWarning() << "expected:" << rhs;
-#endif
- return false;
-}
-
-void tst_QRay3D::create_data()
-{
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<QVector3D>("direction");
-
- // normalized direction vectors
- QTest::newRow("line on x-axis from origin")
- << QVector3D()
- << QVector3D(1.0f, 0.0f, 0.0f);
-
- QTest::newRow("line parallel -z-axis from 3,3,3")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -1.0f);
-
- QTest::newRow("vertical line (parallel to y-axis)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 1.0f, 0.0f);
-
- QTest::newRow("equidistant from all 3 axes")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.57735026919f, 0.57735026919f, 0.57735026919f);
-
- // non-normalized direction vectors
- QTest::newRow("line on x-axis from origin - B")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f);
-
- QTest::newRow("line parallel -z-axis from 3,3,3 - B")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f);
-
- QTest::newRow("vertical line (parallel to y-axis) - B")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 5.3f, 0.0f);
-
- QTest::newRow("equidistant from all 3 axes - B")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(1.0f, 1.0f, 1.0f);
-
- QTest::newRow("negative direction")
- << QVector3D(-3.0f, -3.0f, -3.0f)
- << QVector3D(-1.2f, -1.8f, -2.4f);
-}
-
-void tst_QRay3D::create()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, direction);
- QRay3D ray(point, direction);
- QVERIFY(fuzzyCompare(ray.direction(), direction));
- QVERIFY(fuzzyCompare(ray.origin(), point));
-
- QRay3D ray2;
- QCOMPARE(ray2.origin(), QVector3D(0, 0, 0));
- QCOMPARE(ray2.direction(), QVector3D(1, 0, 0));
- ray2.setOrigin(point);
- ray2.setDirection(direction);
- QVERIFY(fuzzyCompare(ray.direction(), direction));
- QVERIFY(fuzzyCompare(ray.origin(), point));
-}
-
-void tst_QRay3D::projection_data()
-{
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("vector");
- QTest::addColumn<QVector3D>("expected");
-
- QTest::newRow("line on x-axis from origin")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f)
- << QVector3D(0.6f, 0.0f, 0.0f)
- << QVector3D(0.6f, 0.0f, 0.0f);
-
- QTest::newRow("line parallel -z-axis from 3,3,3")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f)
- << QVector3D(3.0f, 3.0f, 2.4f)
- << QVector3D(0.0f, 0.0f, 2.4f);
-
- QTest::newRow("vertical line (parallel to y-axis)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 5.3f, 0.0f)
- << QVector3D(0.5f, 0.6f, 0.5f)
- << QVector3D(0.0f, 0.6f, 0.0f);
-
- QTest::newRow("equidistant from all 3 axes, project y-axis (with some z & x)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(1.0f, 1.0f, 1.0f)
- << QVector3D(0.5f, 5.0f, 0.5f)
- << QVector3D(2.0f, 2.0f, 2.0f);
-
- QTest::newRow("negative direction line, project +ve y-axis (with some z & x)")
- << QVector3D(-3.0f, -3.0f, -3.0f)
- << QVector3D(-1.2f, -1.8f, -2.4f)
- << QVector3D(0.5f, 5.0f, 0.5f)
- << QVector3D(1.241379261016846f, 1.862068772315979f, 2.48275852203369f);
-}
-
-void tst_QRay3D::projection()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, vector);
- QFETCH(QVector3D, expected);
- QRay3D line(point, direction);
- QVector3D result = line.project(vector);
- QVERIFY(fuzzyCompare(result, expected));
-}
-
-void tst_QRay3D::point_data()
-{
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("point_on_line_pos_0_6");
- QTest::addColumn<QVector3D>("point_on_line_neg_7_2");
-
- QTest::newRow("line on x-axis from origin")
- << QVector3D()
- << QVector3D(2.0f, 0.0f, 0.0f)
- << QVector3D(1.2f, 0.0f, 0.0f)
- << QVector3D(-14.4f, 0.0f, 0.0f);
-
- QTest::newRow("line parallel -z-axis from 3,3,3")
- << QVector3D(3.0f, 3.0f, 3.0f)
- << QVector3D(0.0f, 0.0f, -0.7f)
- << QVector3D(3.0f, 3.0f, 2.58f)
- << QVector3D(3.0f, 3.0f, 8.04f);
-
- QTest::newRow("vertical line (parallel to y-axis)")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(0.0f, 5.3f, 0.0f)
- << QVector3D(0.5f, 3.18f, 0.5f)
- << QVector3D(0.5f, -38.16f, 0.5f);
-
- QTest::newRow("equidistant from all 3 axes")
- << QVector3D(0.5f, 0.0f, 0.5f)
- << QVector3D(1.0f, 1.0f, 1.0f)
- << QVector3D(1.1f, 0.6f, 1.1f)
- << QVector3D(-6.7f, -7.2f, -6.7f);
-
- QTest::newRow("negative direction")
- << QVector3D(-3.0f, -3.0f, -3.0f)
- << QVector3D(-1.2f, -1.8f, -2.4f)
- << QVector3D(-3.72f, -4.08f, -4.44f)
- << QVector3D(5.64f, 9.96f, 14.28f);
-}
-
-void tst_QRay3D::point()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point_on_line_pos_0_6);
- QFETCH(QVector3D, point_on_line_neg_7_2);
- QRay3D line(point, direction);
- QVERIFY(fuzzyCompare(line.point(0.6), point_on_line_pos_0_6));
- QVERIFY(fuzzyCompare(line.point(-7.2), point_on_line_neg_7_2));
- QVERIFY(fuzzyCompare(line.fromPoint(point_on_line_pos_0_6), 0.6));
- QVERIFY(fuzzyCompare(line.fromPoint(point_on_line_neg_7_2), -7.2));
-}
-
-void tst_QRay3D::contains_point_data()
-{
- QTest::addColumn<QVector3D>("origin");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<bool>("contains");
-
- QTest::newRow("bogus this line with null direction")
- << QVector3D(1.0, 3.0, 3.0)
- << QVector3D(0.0, 0.0, 0.0)
- << QVector3D(1.0, 2.0, 4.0)
- << false;
-
- QTest::newRow("point at the origin")
- << QVector3D(0.0, 0.0, 0.0)
- << QVector3D(1.0, 3.0, 3.0)
- << QVector3D(0.0, 0.0, 0.0)
- << true;
-
- QTest::newRow("close to the origin")
- << QVector3D(1.0, 1.0, 1.0)
- << QVector3D(1.0, 3.0, 3.0)
- << QVector3D(1.0005, 1.0005, 1.0)
- << false;
-
- QTest::newRow("45 line line in plane x=1")
- << QVector3D(1.0, 3.0, 3.0)
- << QVector3D(0.0, -1.0, -1.0)
- << QVector3D(1.0, 4.0, 4.0)
- << true;
- {
- // This is to prove that the constructed approach give the
- // same results
- QVector3D p(1.0, 3.0, 3.0);
- QVector3D v(0.0, -1.0, -1.0);
-
- QTest::newRow("constructed 45 line line in plane x=1")
- << p
- << v
- << p + v
- << true;
- }
-
- QTest::newRow("intersection with negative s in plane z=-1")
- << QVector3D(1.0f, 2.0f, -1.0f)
- << QVector3D(1.0f, 1.0f, 0.0f)
- << QVector3D(2.0f, 1.0f, 0.0f)
- << false;
-
- QTest::newRow("45 angled line")
- << QVector3D(3.0f, 0.0f, -1.0f)
- << QVector3D(1.0f, -1.0f, 1.0f)
- << QVector3D(6.0f, -3.0f, 2.0f)
- << true;
-
- {
- QVector3D p(-10.0, 3.0, 3.0);
- QVector3D v(0.0, 20.0, -1.0);
- QTest::newRow("constructed vector close to axis")
- << p
- << v
- << p + v * 3.0
- << true;
- }
-
- {
- QVector3D p(1.0, 3.0, 3.0);
- QVector3D v(40.0, 500.0, -1.0);
- QTest::newRow("constructed larger values close to axis")
- << p
- << v
- << p + v
- << true;
- }
-}
-
-void tst_QRay3D::contains_point()
-{
- QFETCH(QVector3D, origin);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point);
- QFETCH(bool, contains);
-
- QRay3D line(origin, direction);
- QCOMPARE(line.contains(point), contains);
-}
-
-void tst_QRay3D::contains_ray_data()
-{
- contains_point_data();
-}
-
-void tst_QRay3D::contains_ray()
-{
- QFETCH(QVector3D, origin);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point);
- QFETCH(bool, contains);
-
- QRay3D line(origin, direction);
- if (contains) {
- QRay3D line2(point, direction);
- QVERIFY(line.contains(line2));
- QVERIFY(line2.contains(line));
-
- // Reversed direction is also contained.
- QRay3D line3(point, -direction);
- QVERIFY(line.contains(line2));
- QVERIFY(line2.contains(line));
-
- // Different direction.
- QRay3D line4(point, QVector3D(direction.y(), direction.x(), direction.z()));
- QVERIFY(!line.contains(line4));
- QVERIFY(!line4.contains(line));
- } else {
- QRay3D line2(point, direction);
- QVERIFY(!line.contains(line2));
- QVERIFY(!line2.contains(line));
- }
-}
-
-void tst_QRay3D::distanceTo_data()
-{
- QTest::addColumn<QVector3D>("origin");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<qreal>("distance");
-
- QTest::newRow("axis-x")
- << QVector3D(6.0f, 0.0f, 0.0f)
- << QVector3D(1.0f, 0.0f, 0.0f)
- << QVector3D(0.0f, 0.0f, 0.0f)
- << qreal(0.0f);
-
- QTest::newRow("axis-x to 1")
- << QVector3D(6.0f, 0.0f, 0.0f)
- << QVector3D(1.0f, 0.0f, 0.0f)
- << QVector3D(0.0f, 1.0f, 0.0f)
- << qreal(1.0f);
-
- QTest::newRow("neg-axis-y")
- << QVector3D(0.0f, 6.0f, 0.0f)
- << QVector3D(0.0f, -1.5f, 0.0f)
- << QVector3D(0.0f, 100.0f, 0.0f)
- << qreal(0.0f);
-
- QTest::newRow("neg-axis-y to 2")
- << QVector3D(0.0f, 6.0f, 0.0f)
- << QVector3D(0.0f, -1.5f, 0.0f)
- << QVector3D(2.0f, 0.0f, 0.0f)
- << qreal(2.0f);
-}
-
-void tst_QRay3D::distanceTo()
-{
- QFETCH(QVector3D, origin);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, point);
- QFETCH(qreal, distance);
-
- QRay3D line(origin, direction);
- QCOMPARE(line.distanceTo(point), distance);
-}
-
-void tst_QRay3D::compare()
-{
- QRay3D ray1(QVector3D(10, 20, 30), QVector3D(-3, -4, -5));
- QRay3D ray2(QVector3D(10, 20, 30), QVector3D(1.5f, 2.0f, 2.5f));
- QRay3D ray3(QVector3D(0, 20, 30), QVector3D(-3, -4, -5));
- QVERIFY(ray1 == ray1);
- QVERIFY(!(ray1 != ray1));
- QVERIFY(qFuzzyCompare(ray1, ray1));
- QVERIFY(ray1 != ray2);
- QVERIFY(!(ray1 == ray2));
- QVERIFY(!qFuzzyCompare(ray1, ray2));
- QVERIFY(ray1 != ray3);
- QVERIFY(!(ray1 == ray3));
- QVERIFY(!qFuzzyCompare(ray1, ray3));
-}
-
-void tst_QRay3D::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QRay3D ray(QVector3D(1.0f, 2.0f, 3.0f), QVector3D(4.0f, 5.0f, 6.0f));
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << ray;
- }
-
- QRay3D ray2;
- {
- QDataStream stream2(data);
- stream2 >> ray2;
- }
-
- QVERIFY(ray == ray2);
-#endif
-}
-
-void tst_QRay3D::transform_data()
-{
- create_data();
-}
-
-void tst_QRay3D::transform()
-{
- QFETCH(QVector3D, point);
- QFETCH(QVector3D, direction);
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QRay3D ray1(point, direction);
- QRay3D ray2(ray1);
- QRay3D ray3;
-
- ray1.transform(m);
- ray3 = ray2.transformed(m);
-
- QCOMPARE(ray1.origin(), ray3.origin());
- QCOMPARE(ray1.direction(), ray3.direction());
-
- QCOMPARE(ray1.origin(), m * point);
- QCOMPARE(ray1.direction(), m.mapVector(direction));
-}
-
-class tst_QRay3DProperties : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QRay3D ray READ ray WRITE setRay)
-public:
- tst_QRay3DProperties(QObject *parent = 0) : QObject(parent) {}
-
- QRay3D ray() const { return r; }
- void setRay(const QRay3D& value) { r = value; }
-
-private:
- QRay3D r;
-};
-
-// Test getting and setting properties via the metaobject system.
-void tst_QRay3D::properties()
-{
- tst_QRay3DProperties obj;
-
- qRegisterMetaType<QRay3D>();
-
- obj.setRay(QRay3D(QVector3D(1, 2, 3), QVector3D(4, 5, 6)));
-
- QRay3D r = qVariantValue<QRay3D>(obj.property("ray"));
- QCOMPARE(r.origin(), QVector3D(1, 2, 3));
- QCOMPARE(r.direction(), QVector3D(4, 5, 6));
-
- obj.setProperty("ray",
- qVariantFromValue
- (QRay3D(QVector3D(-1, -2, -3), QVector3D(-4, -5, -6))));
-
- r = qVariantValue<QRay3D>(obj.property("ray"));
- QCOMPARE(r.origin(), QVector3D(-1, -2, -3));
- QCOMPARE(r.direction(), QVector3D(-4, -5, -6));
-}
-
-void tst_QRay3D::metaTypes()
-{
- int id = qMetaTypeId<QRay3D>();
- QVERIFY(QMetaType::type("QRay3D") == id);
- QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("QRay3D"));
- QVERIFY(QMetaType::isRegistered(id));
-}
-
-QTEST_APPLESS_MAIN(tst_QRay3D)
-
-#include "tst_qray3d.moc"
diff --git a/tests/auto/threed/qsphere3d/qsphere3d.pro b/tests/auto/threed/qsphere3d/qsphere3d.pro
deleted file mode 100644
index cc6feb0a..00000000
--- a/tests/auto/threed/qsphere3d/qsphere3d.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qsphere3d
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-QT += opengl
-CONFIG += warn_on
-SOURCES += tst_qsphere3d.cpp
diff --git a/tests/auto/threed/qsphere3d/tst_qsphere3d.cpp b/tests/auto/threed/qsphere3d/tst_qsphere3d.cpp
deleted file mode 100644
index 1cea5449..00000000
--- a/tests/auto/threed/qsphere3d/tst_qsphere3d.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qsphere3d.h"
-#include <QtGui/qmatrix4x4.h>
-
-class tst_QSphere3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QSphere3D() {}
- ~tst_QSphere3D() {}
-
-private slots:
- void create();
- void contains_data();
- void contains();
- void compare();
- void dataStream();
- void transform();
- void properties();
- void metaTypes();
-};
-
-void tst_QSphere3D::create()
-{
- QSphere3D sphere1;
- QCOMPARE(sphere1.center(), QVector3D(0, 0, 0));
- QCOMPARE(sphere1.radius(), qreal(1.0f));
-
- QSphere3D sphere2(QVector3D(1.0, 2.5f, -4.0f), 5.25f);
- QCOMPARE(sphere2.center(), QVector3D(1.0f, 2.5f, -4.0f));
- QCOMPARE(sphere2.radius(), qreal(5.25f));
-
- sphere2.setCenter(QVector3D(-1.0, -2.5f, 4.0f));
- sphere2.setRadius(10.0f);
- QCOMPARE(sphere2.center(), QVector3D(-1.0f, -2.5f, 4.0f));
- QCOMPARE(sphere2.radius(), qreal(10.0f));
-}
-
-void tst_QSphere3D::contains_data()
-{
- QTest::addColumn<QVector3D>("center");
- QTest::addColumn<qreal>("radius");
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<bool>("contained");
-
- QTest::newRow("origin-inside")
- << QVector3D(0, 0, 0) << qreal(0)
- << QVector3D(0, 0, 0) << true;
- QTest::newRow("origin-outside")
- << QVector3D(0, 0, 0) << qreal(0)
- << QVector3D(0, 0.25f, 0) << false;
-
- QTest::newRow("general-inside")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(1, 2, 3) << true;
-
- QTest::newRow("general-edge-x")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(6, 2, 3) << true;
- QTest::newRow("general-edge-y")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(1, -3, 3) << true;
- QTest::newRow("general-edge-z")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(1, 2, 8) << true;
-
- QTest::newRow("general-outside-x")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(6.25f, 2, 3) << false;
- QTest::newRow("general-outside-y")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(1, -3.5f, 3) << false;
- QTest::newRow("general-outside-z")
- << QVector3D(1, 2, 3) << qreal(5)
- << QVector3D(1, 2, 8.25f) << false;
-}
-
-void tst_QSphere3D::contains()
-{
- QFETCH(QVector3D, center);
- QFETCH(qreal, radius);
- QFETCH(QVector3D, point);
- QFETCH(bool, contained);
-
- QSphere3D sphere(center, radius);
- QCOMPARE(sphere.contains(point), contained);
-}
-
-void tst_QSphere3D::compare()
-{
- QSphere3D sphere1(QVector3D(10, 20, 30), 5.25f);
- QSphere3D sphere2(QVector3D(10, 20, 30), 1.0f);
- QSphere3D sphere3(QVector3D(0, 20, 30), 5.25f);
- QVERIFY(sphere1 == sphere1);
- QVERIFY(!(sphere1 != sphere1));
- QVERIFY(qFuzzyCompare(sphere1, sphere1));
- QVERIFY(sphere1 != sphere2);
- QVERIFY(!(sphere1 == sphere2));
- QVERIFY(!qFuzzyCompare(sphere1, sphere2));
- QVERIFY(sphere1 != sphere3);
- QVERIFY(!(sphere1 == sphere3));
- QVERIFY(!qFuzzyCompare(sphere1, sphere3));
-}
-
-void tst_QSphere3D::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QSphere3D sphere(QVector3D(1.0f, 2.0f, 3.0f), 4.0f);
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << sphere;
- }
-
- QSphere3D sphere2;
- {
- QDataStream stream2(data);
- stream2 >> sphere2;
- }
-
- QVERIFY(sphere == sphere2);
-#endif
-}
-
-void tst_QSphere3D::transform()
-{
- QVector3D center(1, 2, 3);
- qreal radius = 5.25f;
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QSphere3D sphere1(center, radius);
- QSphere3D sphere2(sphere1);
- QSphere3D sphere3;
-
- sphere1.transform(m);
- sphere3 = sphere2.transformed(m);
-
- QCOMPARE(sphere1.center(), sphere3.center());
- QCOMPARE(sphere1.radius(), sphere3.radius());
-
- qreal tradius = m.mapVector(QVector3D(0, radius, 0)).length();
-
- QCOMPARE(sphere1.center(), m * center);
- QCOMPARE(float(sphere1.radius()), float(tradius));
-}
-
-class tst_QSphere3DProperties : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QSphere3D sphere READ sphere WRITE setSphere)
-public:
- tst_QSphere3DProperties(QObject *parent = 0) : QObject(parent) {}
-
- QSphere3D sphere() const { return s; }
- void setSphere(const QSphere3D& value) { s = value; }
-
-private:
- QSphere3D s;
-};
-
-// Test getting and setting properties via the metaobject system.
-void tst_QSphere3D::properties()
-{
- tst_QSphere3DProperties obj;
-
- qRegisterMetaType<QSphere3D>();
-
- obj.setSphere(QSphere3D(QVector3D(1, 2, 3), 4));
-
- QSphere3D s = qVariantValue<QSphere3D>(obj.property("sphere"));
- QCOMPARE(s.center(), QVector3D(1, 2, 3));
- QCOMPARE(s.radius(), qreal(4.0f));
-
- obj.setProperty("sphere",
- qVariantFromValue(QSphere3D(QVector3D(-1, -2, -3), -4)));
-
- s = qVariantValue<QSphere3D>(obj.property("sphere"));
- QCOMPARE(s.center(), QVector3D(-1, -2, -3));
- QCOMPARE(s.radius(), qreal(-4.0f));
-}
-
-void tst_QSphere3D::metaTypes()
-{
- int id = qMetaTypeId<QSphere3D>();
- QVERIFY(QMetaType::type("QSphere3D") == id);
- QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("QSphere3D"));
- QVERIFY(QMetaType::isRegistered(id));
-}
-
-QTEST_APPLESS_MAIN(tst_QSphere3D)
-
-#include "tst_qsphere3d.moc"
diff --git a/tests/auto/threed/qstereoimage/qstereoimage.pro b/tests/auto/threed/qstereoimage/qstereoimage.pro
deleted file mode 100644
index 15a8c87c..00000000
--- a/tests/auto/threed/qstereoimage/qstereoimage.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = tst_qstereoimage
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../../examples/stereophoto
-VPATH += ../../../../examples/stereophoto
-
-HEADERS += qstereoimage.h
-SOURCES += tst_qstereoimage.cpp qstereoimage.cpp
diff --git a/tests/auto/threed/qstereoimage/tst_qstereoimage.cpp b/tests/auto/threed/qstereoimage/tst_qstereoimage.cpp
deleted file mode 100644
index 72281296..00000000
--- a/tests/auto/threed/qstereoimage/tst_qstereoimage.cpp
+++ /dev/null
@@ -1,428 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qstereoimage.h"
-#include <QtGui/qpainter.h>
-
-class tst_QStereoImage : public QObject
-{
- Q_OBJECT
-public:
- tst_QStereoImage() {}
- ~tst_QStereoImage() {}
-
-private slots:
- void separateNonEqual_data();
- void separateNonEqual();
- void createAndConvert_data();
- void createAndConvert();
- void painting_data();
- void painting();
-
-private:
- static QImage generateImage
- (int width, int height, const QColor &color,
- QImage::Format format = QImage::Format_RGB32);
- static QImage generateStereoPair
- (int width, int height, const QColor &lcolor, const QColor &rcolor,
- QStereoImage::Layout layout = QStereoImage::LeftRight,
- QImage::Format format = QImage::Format_RGB32);
-};
-
-QImage tst_QStereoImage::generateImage
- (int width, int height, const QColor &color, QImage::Format format)
-{
- QImage image(width, height, format);
- image.fill(color.rgba());
- return image;
-}
-
-QImage tst_QStereoImage::generateStereoPair
- (int width, int height, const QColor &lcolor, const QColor &rcolor,
- QStereoImage::Layout layout, QImage::Format format)
-{
- QImage image;
- QPoint left, right;
-
- switch (layout) {
- default:
- case QStereoImage::LeftRight:
- image = QImage(width * 2, height, format);
- left = QPoint(0, 0);
- right = QPoint(width, 0);
- break;
-
- case QStereoImage::RightLeft:
- image = QImage(width * 2, height, format);
- left = QPoint(width, 0);
- right = QPoint(0, 0);
- break;
-
- case QStereoImage::TopBottom:
- image = QImage(width, height * 2, format);
- left = QPoint(0, 0);
- right = QPoint(0, height);
- break;
-
- case QStereoImage::BottomTop:
- image = QImage(width, height * 2, format);
- left = QPoint(0, height);
- right = QPoint(0, 0);
- break;
- }
-
- uint lpixel = lcolor.rgba();
- uint rpixel = rcolor.rgba();
- for (int y = 0; y < height; ++y) {
- for (int x = 0; x < width; ++x) {
- image.setPixel(x + left.x(), y + left.y(), lpixel);
- image.setPixel(x + right.x(), y + right.y(), rpixel);
- }
- }
-
- return image;
-}
-
-// Test creation of a separate image with non-equal sizes for left
-// and right images, and check that conversions do what we expect.
-void tst_QStereoImage::separateNonEqual_data()
-{
- QTest::addColumn<int>("toLayout");
-
- QTest::newRow("Separate -> LeftRight")
- << int(QStereoImage::LeftRight);
- QTest::newRow("Separate -> RightLeft")
- << int(QStereoImage::RightLeft);
- QTest::newRow("Separate -> TopBottom")
- << int(QStereoImage::TopBottom);
- QTest::newRow("Separate -> BottomTop")
- << int(QStereoImage::BottomTop);
-}
-void tst_QStereoImage::separateNonEqual()
-{
- QFETCH(int, toLayout);
-
- QStereoImage::Layout to = QStereoImage::Layout(toLayout);
-
- QStereoImage image1;
- QVERIFY(image1.isNull());
- QCOMPARE(image1.size(), QSize(0, 0));
- QCOMPARE(image1.width(), 0);
- QCOMPARE(image1.height(), 0);
- QVERIFY(image1.layout() == QStereoImage::Separate);
-
- QImage left(generateImage(120, 100, Qt::red));
- QImage right(generateImage(125, 90, Qt::blue));
-
- image1.setLeftImage(left);
-
- QVERIFY(!image1.isNull());
- QCOMPARE(image1.size(), QSize(120, 100));
- QCOMPARE(image1.width(), 120);
- QCOMPARE(image1.height(), 100);
- QVERIFY(image1.layout() == QStereoImage::Separate);
- QCOMPARE(image1.leftImage(), left);
- QVERIFY(image1.rightImage().isNull());
- QVERIFY(image1.wholeImage().isNull());
-
- QStereoImage image2(image1);
-
- image1.setRightImage(right);
-
- QVERIFY(!image1.isNull());
- QCOMPARE(image1.size(), QSize(125, 100)); // Expands to max(left,right).
- QCOMPARE(image1.width(), 125);
- QCOMPARE(image1.height(), 100);
- QVERIFY(image1.layout() == QStereoImage::Separate);
- QCOMPARE(image1.leftImage(), left);
- QCOMPARE(image1.rightImage(), right);
- QVERIFY(image1.wholeImage().isNull());
-
- QVERIFY(!image2.isNull());
- QCOMPARE(image2.size(), QSize(120, 100));
- QCOMPARE(image2.width(), 120);
- QCOMPARE(image2.height(), 100);
- QVERIFY(image2.layout() == QStereoImage::Separate);
- QCOMPARE(image2.leftImage(), left);
- QVERIFY(image2.rightImage().isNull());
- QVERIFY(image2.wholeImage().isNull());
-
- QImage wholeTo(generateStereoPair(125, 100, Qt::red, Qt::blue, to));
-
- image1.setLayout(to);
- QVERIFY(!image1.isNull());
- QCOMPARE(image1.size(), QSize(125, 100));
- QCOMPARE(image1.width(), 125);
- QCOMPARE(image1.height(), 100);
- QVERIFY(image1.layout() == to);
- QCOMPARE(image1.leftImage().size(), QSize(125, 100));
- QCOMPARE(image1.leftImage().copy(0, 0, 120, 100), left);
- QCOMPARE(image1.rightImage().size(), QSize(125, 100));
- QCOMPARE(image1.rightImage().copy(0, 0, 125, 90), right);
- QCOMPARE(image1.wholeImage().size(), wholeTo.size());
-}
-
-// Test creating stereo images in various formats and converting
-// them to all other possible formats.
-void tst_QStereoImage::createAndConvert_data()
-{
- QTest::addColumn<int>("fromLayout");
- QTest::addColumn<int>("toLayout");
-
- // Foo -> Separate is handled in createAndConvert() below, so we
- // don't need to explicitly list it here.
-
- QTest::newRow("Separate -> LeftRight")
- << int(QStereoImage::Separate)
- << int(QStereoImage::LeftRight);
- QTest::newRow("Separate -> RightLeft")
- << int(QStereoImage::Separate)
- << int(QStereoImage::RightLeft);
- QTest::newRow("Separate -> TopBottom")
- << int(QStereoImage::Separate)
- << int(QStereoImage::TopBottom);
- QTest::newRow("Separate -> BottomTop")
- << int(QStereoImage::Separate)
- << int(QStereoImage::BottomTop);
-
- QTest::newRow("LeftRight -> LeftRight")
- << int(QStereoImage::LeftRight)
- << int(QStereoImage::LeftRight);
- QTest::newRow("LeftRight -> RightLeft")
- << int(QStereoImage::LeftRight)
- << int(QStereoImage::RightLeft);
- QTest::newRow("LeftRight -> TopBottom")
- << int(QStereoImage::LeftRight)
- << int(QStereoImage::TopBottom);
- QTest::newRow("LeftRight -> BottomTop")
- << int(QStereoImage::LeftRight)
- << int(QStereoImage::BottomTop);
-
- QTest::newRow("RightLeft -> LeftRight")
- << int(QStereoImage::RightLeft)
- << int(QStereoImage::LeftRight);
- QTest::newRow("RightLeft -> RightLeft")
- << int(QStereoImage::RightLeft)
- << int(QStereoImage::RightLeft);
- QTest::newRow("RightLeft -> TopBottom")
- << int(QStereoImage::RightLeft)
- << int(QStereoImage::TopBottom);
- QTest::newRow("RightLeft -> BottomTop")
- << int(QStereoImage::RightLeft)
- << int(QStereoImage::BottomTop);
-
- QTest::newRow("TopBottom -> LeftRight")
- << int(QStereoImage::TopBottom)
- << int(QStereoImage::LeftRight);
- QTest::newRow("TopBottom -> RightLeft")
- << int(QStereoImage::TopBottom)
- << int(QStereoImage::RightLeft);
- QTest::newRow("TopBottom -> TopBottom")
- << int(QStereoImage::TopBottom)
- << int(QStereoImage::TopBottom);
- QTest::newRow("TopBottom -> BottomTop")
- << int(QStereoImage::TopBottom)
- << int(QStereoImage::BottomTop);
-
- QTest::newRow("BottomTop -> LeftRight")
- << int(QStereoImage::BottomTop)
- << int(QStereoImage::LeftRight);
- QTest::newRow("BottomTop -> RightLeft")
- << int(QStereoImage::BottomTop)
- << int(QStereoImage::RightLeft);
- QTest::newRow("BottomTop -> TopBottom")
- << int(QStereoImage::BottomTop)
- << int(QStereoImage::TopBottom);
- QTest::newRow("BottomTop -> BottomTop")
- << int(QStereoImage::BottomTop)
- << int(QStereoImage::BottomTop);
-}
-
-void tst_QStereoImage::createAndConvert()
-{
- QFETCH(int, fromLayout);
- QFETCH(int, toLayout);
-
- QStereoImage::Layout from = QStereoImage::Layout(fromLayout);
- QStereoImage::Layout to = QStereoImage::Layout(toLayout);
-
- QStereoImage image2;
-
- QStereoImage image1(QSize(120, 100), QImage::Format_RGB32, from);
- QVERIFY(!image1.isNull());
- QCOMPARE(image1.size(), QSize(120, 100));
- QCOMPARE(image1.width(), 120);
- QCOMPARE(image1.height(), 100);
- QVERIFY(image1.layout() == from);
- QCOMPARE(image1.leftImage().size(), QSize(120, 100));
- QCOMPARE(image1.rightImage().size(), QSize(120, 100));
- if (from == QStereoImage::Separate)
- QVERIFY(image1.wholeImage().isNull());
- else if (from == QStereoImage::LeftRight || from == QStereoImage::RightLeft)
- QCOMPARE(image1.wholeImage().size(), QSize(240, 100));
- else
- QCOMPARE(image1.wholeImage().size(), QSize(120, 200));
-
- QImage left(generateImage(120, 100, Qt::red));
- QImage right(generateImage(120, 100, Qt::blue));
- QImage whole(generateStereoPair(120, 100, Qt::red, Qt::blue, from));
- QImage wholeTo(generateStereoPair(120, 100, Qt::red, Qt::blue, to));
-
- image1.setLeftImage(left);
- image1.setRightImage(right);
-
- QCOMPARE(image1.leftImage(), left);
- QCOMPARE(image1.rightImage(), right);
- if (from == QStereoImage::Separate)
- QVERIFY(image1.wholeImage().isNull());
- else
- QCOMPARE(image1.wholeImage(), whole);
-
- image2 = image1;
-
- // Check separate conversion, which will also test copy-on-write.
- image1.setLayout(QStereoImage::Separate);
-
- QCOMPARE(image1.leftImage(), left);
- QCOMPARE(image1.rightImage(), right);
- QVERIFY(image1.wholeImage().isNull());
- QVERIFY(!image1.isNull());
- QCOMPARE(image1.size(), QSize(120, 100));
- QCOMPARE(image1.width(), 120);
- QCOMPARE(image1.height(), 100);
- QVERIFY(image1.layout() == QStereoImage::Separate);
-
- QVERIFY(image2.layout() == from);
-
- image2.setLayout(to);
- QVERIFY(!image2.isNull());
- QCOMPARE(image2.size(), QSize(120, 100));
- QCOMPARE(image2.width(), 120);
- QCOMPARE(image2.height(), 100);
- QVERIFY(image2.layout() == to);
- QCOMPARE(image2.leftImage(), left);
- QCOMPARE(image2.rightImage(), right);
- QCOMPARE(image2.wholeImage(), wholeTo);
-
- // Test creation with width and height instead of QSize.
- QStereoImage image3(120, 100, QImage::Format_RGB32, from);
- QVERIFY(!image3.isNull());
- QCOMPARE(image3.size(), QSize(120, 100));
- QCOMPARE(image3.width(), 120);
- QCOMPARE(image3.height(), 100);
- QVERIFY(image3.layout() == from);
- image3.setLeftImage(left);
- image3.setRightImage(right);
- QCOMPARE(image3.leftImage(), left);
- QCOMPARE(image3.rightImage(), right);
- if (from == QStereoImage::Separate)
- QVERIFY(image3.wholeImage().isNull());
- else
- QCOMPARE(image3.wholeImage(), whole);
-}
-
-// Test painting into the two halves of a stereo image.
-void tst_QStereoImage::painting_data()
-{
- QTest::addColumn<int>("layoutValue");
-
- QTest::newRow("Separate")
- << int(QStereoImage::Separate);
- QTest::newRow("LeftRight")
- << int(QStereoImage::LeftRight);
- QTest::newRow("RightLeft")
- << int(QStereoImage::RightLeft);
- QTest::newRow("TopBottom")
- << int(QStereoImage::TopBottom);
- QTest::newRow("BottomTop")
- << int(QStereoImage::BottomTop);
-}
-void tst_QStereoImage::painting()
-{
- QFETCH(int, layoutValue);
-
- QStereoImage::Layout layout = QStereoImage::Layout(layoutValue);
-
- QStereoImage image1(QSize(120, 100), QImage::Format_ARGB32, layout);
- QVERIFY(image1.layout() == layout);
-
- QImage left(generateImage(120, 100, Qt::red, QImage::Format_ARGB32));
- QImage right(generateImage(120, 100, Qt::blue, QImage::Format_ARGB32));
- QImage leftTo(generateImage(120, 100, Qt::green, QImage::Format_ARGB32));
- QImage rightTo(generateImage(120, 100, Qt::yellow, QImage::Format_ARGB32));
-
- image1.setLeftImage(left);
- image1.setRightImage(right);
-
- // Fill a rectangle that is partially out of bounds to check
- // that painting is actually being constrained by a clip region.
- QPainter leftPainter;
- image1.beginPaintingLeft(&leftPainter);
- leftPainter.fillRect(-10, -10, 600, 300, Qt::green);
- leftPainter.end();
-
- QCOMPARE(image1.leftImage(), leftTo);
- QCOMPARE(image1.rightImage(), right);
-
- QPainter rightPainter;
- image1.beginPaintingRight(&rightPainter);
- rightPainter.fillRect(-10, -10, 600, 300, Qt::yellow);
- rightPainter.end();
-
- QCOMPARE(image1.leftImage(), leftTo);
- QCOMPARE(image1.rightImage(), rightTo);
-
- // Draw the left and right halves into a different painter.
- QImage whole(generateStereoPair(120, 100, Qt::green, Qt::yellow,
- QStereoImage::LeftRight,
- QImage::Format_ARGB32));
- QImage image2(240, 100, QImage::Format_ARGB32);
- QPainter painter(&image2);
- image1.drawLeft(&painter, QRectF(0, 0, 120, 100));
- image1.drawRight(&painter, QRectF(120, 0, 120, 100));
- painter.end();
- QCOMPARE(image2, whole);
-}
-
-QTEST_APPLESS_MAIN(tst_QStereoImage)
-
-#include "tst_qstereoimage.moc"
diff --git a/tests/auto/threed/qtriangle3d/qtriangle3d.pro b/tests/auto/threed/qtriangle3d/qtriangle3d.pro
deleted file mode 100644
index 31bfc104..00000000
--- a/tests/auto/threed/qtriangle3d/qtriangle3d.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = tst_qtriangle3d
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qtriangle3d.cpp
diff --git a/tests/auto/threed/qtriangle3d/tst_qtriangle3d.cpp b/tests/auto/threed/qtriangle3d/tst_qtriangle3d.cpp
deleted file mode 100644
index e9df6abe..00000000
--- a/tests/auto/threed/qtriangle3d/tst_qtriangle3d.cpp
+++ /dev/null
@@ -1,714 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include "qtriangle3d.h"
-#include "qplane3d.h"
-
-class tst_QTriangle3D : public QObject
-{
- Q_OBJECT
-public:
- tst_QTriangle3D() {}
- ~tst_QTriangle3D() {}
-
-private slots:
- void defaultTriangle();
-
- void create_data();
- void create();
-
- void contains_data();
- void contains();
-
- void intersect_data();
- void intersect();
-
- void uv_data();
- void uv();
-
- void transform_data();
- void transform();
-
- void compare();
-
- void dataStream();
-
- void properties();
- void metaTypes();
-};
-
-void tst_QTriangle3D::defaultTriangle()
-{
- QTriangle3D triangle;
- QCOMPARE(triangle.p(), QVector3D(0.0f, 0.0f, 0.0f));
- QCOMPARE(triangle.q(), QVector3D(1.0f, 0.0f, 0.0f));
- QCOMPARE(triangle.r(), QVector3D(0.0f, 1.0f, 0.0f));
-}
-
-void tst_QTriangle3D::create_data()
-{
- QTest::addColumn<QVector3D>("p");
- QTest::addColumn<QVector3D>("q");
- QTest::addColumn<QVector3D>("r");
- QTest::addColumn<bool>("isDegenerate");
- QTest::addColumn<QPlane3D>("plane");
- QTest::addColumn<QVector3D>("centroid");
-
- QTest::newRow("minimal at null")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 0.0f);
- QTest::newRow("minimal at offset")
- << QVector3D(2.0f, 2.0f, 2.0f) // p
- << QVector3D(2.0f, 2.0f, 2.0f) // q
- << QVector3D(2.0f, 2.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(2.0f, 2.0f, 2.0f); // centroid
- QTest::newRow("line from 0(p) [a]")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 0.5f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 2.5f/3.0f); // centroid
- QTest::newRow("line from 0(p) [b]")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 1.0f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 1.0f); // centroid
- QTest::newRow("line from 0(p) [c]")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 1.5f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 3.5f/3.0f); // centroid
- QTest::newRow("line from 0(q) [a]")
- << QVector3D(0.0f, 0.0f, 0.5f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 2.5f/3.0f); // centroid
- QTest::newRow("line from 0(q) [b]")
- << QVector3D(0.0f, 0.0f, 1.0f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 1.0f); // centroid
- QTest::newRow("line from 0(q) [c]")
- << QVector3D(0.0f, 0.0f, 1.5f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 3.5f/3.0f); // centroid
- QTest::newRow("line from 0(r) [a]")
- << QVector3D(0.0f, 0.0f, 0.5f) // p
- << QVector3D(0.0f, 0.0f, 2.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 2.5f/3.0f); // centroid
- QTest::newRow("line from 0(r) [b]")
- << QVector3D(0.0f, 0.0f, 1.0f) // p
- << QVector3D(0.0f, 0.0f, 2.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 1.0f); // centroid
- QTest::newRow("line from 0(r) [c]")
- << QVector3D(0.0f, 0.0f, 1.5f) // p
- << QVector3D(0.0f, 0.0f, 2.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 3.5f/3.0f); // centroid
- QTest::newRow("width 0 [a]")
- << QVector3D(0.0f, 0.0f, 2.0f) // p
- << QVector3D(0.0f, 0.0f, 2.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 4.0f/3.0f); // centroid
- QTest::newRow("width 0 [b]")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 2.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 2.0f/3.0f); // centroid
- QTest::newRow("width 0 [c]")
- << QVector3D(0.0f, 0.0f, 2.0f) // p
- << QVector3D(0.0f, 0.0f, 2.0f) // q
- << QVector3D(0.0f, 0.0f, 4.0f) // r
- << true // degenerate
- << QPlane3D() // plane (degenerate, meaning meaningless)
- << QVector3D(0.0f, 0.0f, 8.0f/3.0f); // centroid
-
- /* The above only tests degenerate triangles colinear with the z axis.
- May also want to tests degenerate triangles offset from origin and
- degenerate triangles on other angles (e.g. x axis, y axis, not colinear
- with any axis)
- */
-
- QTest::newRow("simple at origin")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 4.0f, 0.0f) // q
- << QVector3D(0.0f, 2.0f, 5.0f) // r
- << false // degenerate
- << QPlane3D(QVector3D(0.0f, 0.0f, 0.0f), QVector3D(1.0f, 0.0f, 0.0f)) // plane
- << QVector3D(0.0f, 6.0f/3.0f, 5.0f/3.0f); // centroid
-
- QTest::newRow("simple offset from origin")
- << QVector3D(1.0f, 1.0f, 0.0f) // p
- << QVector3D(1.0f, 5.0f, 0.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << false // degenerate
- << QPlane3D(QVector3D(1.0f, 0.0f, 0.0f), QVector3D(1.0f, 0.0f, 0.0f)) // plane
- << QVector3D(1.0f, 3.0f, 5.0f/3.0f); // centroid
-}
-
-void tst_QTriangle3D::create()
-{
- QFETCH(QVector3D, p);
- QFETCH(QVector3D, q);
- QFETCH(QVector3D, r);
- QFETCH(bool, isDegenerate);
- QFETCH(QPlane3D, plane);
- QFETCH(QVector3D, centroid);
-
- QTriangle3D triangle(p, q, r);
-
- QCOMPARE(triangle.p(), p);
- QCOMPARE(triangle.q(), q);
- QCOMPARE(triangle.r(), r);
-
- QCOMPARE(triangle.faceNormal(), QVector3D::crossProduct(q - p, r - q));
-
- if (!isDegenerate) {
- QPlane3D trianglePlane = triangle.plane();
- QVERIFY(plane.contains(trianglePlane.origin()));
- QCOMPARE(plane.normal().normalized(),
- trianglePlane.normal().normalized());
- }
- QCOMPARE(triangle.center(), centroid);
-
- QTriangle3D triangle2;
- triangle2.setP(p);
- triangle2.setQ(q);
- triangle2.setR(r);
- QCOMPARE(triangle2.p(), p);
- QCOMPARE(triangle2.q(), q);
- QCOMPARE(triangle2.r(), r);
- QVERIFY(triangle == triangle2);
-}
-
-void tst_QTriangle3D::contains_data()
-{
- QTest::addColumn<QVector3D>("p");
- QTest::addColumn<QVector3D>("q");
- QTest::addColumn<QVector3D>("r");
- QTest::addColumn<QVector3D>("point");
- QTest::addColumn<bool>("contains");
-
- QTest::newRow("minimal at null, same")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << QVector3D(0.0f, 0.0f, 0.0f) // point
- << false; // contains
- QTest::newRow("acute at p")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.0f, 2.0f) // point
- << true; // contains
- QTest::newRow("acute at q")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.0f, 4.0f) // point
- << true; // contains
- QTest::newRow("acute at r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 3.0f, 3.0f) // point
- << true; // contains
- QTest::newRow("acute at p-q")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.0f, 3.0f) // point
- << true; // contains
- QTest::newRow("acute at p-r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.5f, 2.5f) // point
- << true; // contains
- QTest::newRow("acute at q-r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.5f, 3.5f) // point
- << true; // contains
- QTest::newRow("acute internal")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.5f, 3.0f) // point
- << true; // contains
- QTest::newRow("acute external a")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.8f, 2.0f) // point
- << false; // contains
- QTest::newRow("acute external b")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 2.8f, 4.0f) // point
- << false; // contains
- QTest::newRow("acute external c")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.0f, 1.4f, 3.0f) // point
- << false; // contains
- QTest::newRow("acute above plane")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(1.3f, 2.5f, 3.0f) // point
- << false; // contains
- QTest::newRow("acute below plane")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.8f, 2.5f, 3.0f) // point
- << false; // contains
- QTest::newRow("obtuse a")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(1.0f, 2.5f, 4.8f) // point
- << false; // contains
- QTest::newRow("obtuse b")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(1.0f, 2.5f, 4.3f) // point
- << true; // contains
- QTest::newRow("obtuse c")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(1.0f, 2.5f, 4.5f) // point
- << true; // contains
- QTest::newRow("obtuse d")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(1.2f, 2.5f, 4.3f) // point
- << false; // contains
- QTest::newRow("obtuse e")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(0.8f, 2.5f, 4.3f) // point
- << false; // contains
-}
-
-void tst_QTriangle3D::contains()
-{
- QFETCH(QVector3D, p);
- QFETCH(QVector3D, q);
- QFETCH(QVector3D, r);
- QFETCH(QVector3D, point);
- QFETCH(bool, contains);
- // qDebug("Triangle: P(%0.10f, %0.10f, %0.10f) Q(%0.10f, %0.10f, %0.10f) R(%0.10f, %0.10f, %0.10f)",
- // p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), r.x(), r.y(), r.z());
- // qDebug("Point: (%0.10f, %0.10f, %0.10f)", point.x(), point.y(), point.z());
- QCOMPARE(QTriangle3D(p, q, r).contains(point), contains);
-}
-
-void tst_QTriangle3D::intersect_data()
-{
- QTest::addColumn<QVector3D>("p");
- QTest::addColumn<QVector3D>("q");
- QTest::addColumn<QVector3D>("r");
- QTest::addColumn<QVector3D>("origin");
- QTest::addColumn<QVector3D>("direction");
- QTest::addColumn<QVector3D>("intersection");
- QTest::addColumn<bool>("doesIntersect");
-
- QTest::newRow("minimal at null, same")
- << QVector3D(0.0f, 0.0f, 0.0f) // p
- << QVector3D(0.0f, 0.0f, 0.0f) // q
- << QVector3D(0.0f, 0.0f, 0.0f) // r
- << QVector3D(0.0f, 0.0f, 0.0f) // origin
- << QVector3D(0.0f, 0.0f, 1.0f) // direction
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // degenerate triangles cannot intersect
-
- /*
- lines perpendicular to triangle plane.
- */
- QTest::newRow("acute at p")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.0f, 2.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.0f, 2.0f) // intersection
- << true; // intersects
- QTest::newRow("acute at q")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.0f, 4.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.0f, 4.0f) // intersection
- << true; // intersects
- QTest::newRow("acute at r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 3.0f, 3.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 3.0f, 3.0f) // intersection
- << true; // intersects
- QTest::newRow("acute at p-q")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.0f, 3.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.0f, 3.0f) // intersection
- << true; // intersects
- QTest::newRow("acute at p-r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.5f, 2.5f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.5f, 2.5f) // intersection
- << true; // intersects
- QTest::newRow("acute at q-r")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.5f, 3.5f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.5f, 3.5f) // intersection
- << true; // intersects
- QTest::newRow("acute internal")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.5f, 3.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.5f, 3.0f) // intersection
- << true; // intersects
- QTest::newRow("acute external a")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.8f, 2.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // intersects
- QTest::newRow("acute external b")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 2.8f, 4.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // intersects
- QTest::newRow("acute external c")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 3.0f) // r
- << QVector3D(0.0f, 1.4f, 3.0f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // intersects
- QTest::newRow("obtuse a")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(0.0f, 2.5f, 4.8f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // intersects
- QTest::newRow("obtuse b")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(0.0f, 2.5f, 4.3f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.5f, 4.3f) // intersection
- << true; // intersects
- QTest::newRow("obtuse c")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(0.0f, 2.5f, 4.5f) // origin
- << QVector3D(1.0f, 0.0f, 0.0f) // direction
- << QVector3D(1.0f, 2.5f, 4.5f) // intersection
- << true; // intersects
-
- QTest::newRow("in-triangle-plane")
- << QVector3D(1.0f, 2.0f, 2.0f) // p
- << QVector3D(1.0f, 2.0f, 4.0f) // q
- << QVector3D(1.0f, 3.0f, 5.0f) // r
- << QVector3D(1.0f, 2.0f, 2.0f) // origin (p)
- << QVector3D(0.0f, 0.0f, 2.0f) // direction (q - p)
- << QVector3D(0.0f, 0.0f, 0.0f) // intersection
- << false; // intersects
-}
-
-void tst_QTriangle3D::intersect()
-{
- QFETCH(QVector3D, p);
- QFETCH(QVector3D, q);
- QFETCH(QVector3D, r);
- QFETCH(QVector3D, origin);
- QFETCH(QVector3D, direction);
- QFETCH(QVector3D, intersection);
- QFETCH(bool, doesIntersect);
-
- QTriangle3D triangle(p, q, r);
- QRay3D line(origin, direction);
- QCOMPARE(triangle.intersects(line), doesIntersect);
-
- qreal result = triangle.intersection(line);
- if (doesIntersect)
- QCOMPARE(line.point(result), intersection);
- else
- QVERIFY(qIsNaN(result));
-}
-
-void tst_QTriangle3D::uv_data()
-{
- contains_data();
-}
-
-void tst_QTriangle3D::uv()
-{
- QFETCH(QVector3D, p);
- QFETCH(QVector3D, q);
- QFETCH(QVector3D, r);
-
- if (p == q || p == r || q == r)
- return; // Ignore degenerate triangles for this test.
-
- QTriangle3D triangle(p, q, r);
-
- QCOMPARE(triangle.uv(p), QVector2D(1, 0));
- QCOMPARE(triangle.uv(q), QVector2D(0, 1));
- QCOMPARE(triangle.uv(r), QVector2D(0, 0));
-
- QCOMPARE(triangle.uv((p + q) / 2.0f), QVector2D(0.5f, 0.5f));
- QCOMPARE(triangle.uv((p + r) / 2.0f), QVector2D(0.5f, 0.0f));
- QCOMPARE(triangle.uv((q + r) / 2.0f), QVector2D(0.0f, 0.5f));
-
- QVector2D v1(triangle.uv((p + q + r) / 3.0f));
- QVector2D v2(1.0f / 3.0f, 1.0f / 3.0f);
- QVERIFY(qFuzzyCompare(float(v1.x()), float(v2.x())));
- QVERIFY(qFuzzyCompare(float(v1.y()), float(v2.y())));
-}
-
-void tst_QTriangle3D::transform_data()
-{
- create_data();
-}
-
-void tst_QTriangle3D::transform()
-{
- QFETCH(QVector3D, p);
- QFETCH(QVector3D, q);
- QFETCH(QVector3D, r);
-
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QTriangle3D tri1(p, q, r);
- QTriangle3D tri2(tri1);
- QTriangle3D tri3;
-
- tri1.transform(m);
- tri3 = tri2.transformed(m);
-
- QCOMPARE(tri1.p(), tri3.p());
- QCOMPARE(tri1.q(), tri3.q());
- QCOMPARE(tri1.r(), tri3.r());
-
- QCOMPARE(tri1.p(), m * p);
- QCOMPARE(tri1.q(), m * q);
- QCOMPARE(tri1.r(), m * r);
-}
-
-void tst_QTriangle3D::compare()
-{
- QVector3D p1(1.0f, 2.0f, 3.0f);
- QVector3D q1(4.0f, 5.0f, 6.0f);
- QVector3D r1(7.0f, 8.0f, 9.0f);
- QVector3D p2(-1.0f, -2.0f, -3.0f);
- QVector3D q2(-4.0f, -5.0f, -6.0f);
- QVector3D r2(-7.0f, -8.0f, -9.0f);
-
- QTriangle3D tri1(p1, q1, r1);
- QTriangle3D tri2(p1, q1, r1);
- QVERIFY(tri1 == tri2);
- QVERIFY(!(tri1 != tri2));
- QVERIFY(qFuzzyCompare(tri1, tri2));
-
- QTriangle3D tri3(p2, q1, r1);
- QVERIFY(tri1 != tri3);
- QVERIFY(!(tri1 == tri3));
- QVERIFY(!qFuzzyCompare(tri1, tri3));
-
- QTriangle3D tri4(p1, q2, r1);
- QVERIFY(tri1 != tri4);
- QVERIFY(!(tri1 == tri4));
- QVERIFY(!qFuzzyCompare(tri1, tri4));
-
- QTriangle3D tri5(p1, q1, r2);
- QVERIFY(tri1 != tri5);
- QVERIFY(!(tri1 == tri5));
- QVERIFY(!qFuzzyCompare(tri1, tri5));
-
- QTriangle3D tri6(p2, q2, r2);
- QVERIFY(tri1 != tri6);
- QVERIFY(!(tri1 == tri6));
- QVERIFY(!qFuzzyCompare(tri1, tri6));
-}
-
-void tst_QTriangle3D::dataStream()
-{
-#ifndef QT_NO_DATASTREAM
- QTriangle3D triangle(QVector3D(1.0f, 2.0f, 3.0f),
- QVector3D(4.0f, 5.0f, 6.0f),
- QVector3D(7.0f, 8.0f, 9.0f));
-
- QByteArray data;
- {
- QDataStream stream(&data, QIODevice::WriteOnly);
- stream << triangle;
- }
-
- QTriangle3D triangle2;
- {
- QDataStream stream2(data);
- stream2 >> triangle2;
- }
-
- QVERIFY(triangle == triangle2);
-#endif
-}
-
-class tst_QTriangle3DProperties : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QTriangle3D triangle READ triangle WRITE setTriangle)
-public:
- tst_QTriangle3DProperties(QObject *parent = 0) : QObject(parent) {}
-
- QTriangle3D triangle() const { return t; }
- void setTriangle(const QTriangle3D& value) { t = value; }
-
-private:
- QTriangle3D t;
-};
-
-// Test getting and setting properties via the metaobject system.
-void tst_QTriangle3D::properties()
-{
- tst_QTriangle3DProperties obj;
-
- qRegisterMetaType<QTriangle3D>();
-
- obj.setTriangle(QTriangle3D(QVector3D(1, 2, 3), QVector3D(4, 5, 6),
- QVector3D(7, 8, 9)));
-
- QTriangle3D t = qVariantValue<QTriangle3D>(obj.property("triangle"));
- QCOMPARE(t.p(), QVector3D(1, 2, 3));
- QCOMPARE(t.q(), QVector3D(4, 5, 6));
- QCOMPARE(t.r(), QVector3D(7, 8, 9));
-
- obj.setProperty("triangle",
- qVariantFromValue
- (QTriangle3D(QVector3D(-1, -2, -3),
- QVector3D(-4, -5, -6),
- QVector3D(-7, -8, -9))));
-
- t = qVariantValue<QTriangle3D>(obj.property("triangle"));
- QCOMPARE(t.p(), QVector3D(-1, -2, -3));
- QCOMPARE(t.q(), QVector3D(-4, -5, -6));
- QCOMPARE(t.r(), QVector3D(-7, -8, -9));
-}
-
-void tst_QTriangle3D::metaTypes()
-{
- int id = qMetaTypeId<QTriangle3D>();
- QVERIFY(QMetaType::type("QTriangle3D") == id);
- QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("QTriangle3D"));
- QVERIFY(QMetaType::isRegistered(id));
-}
-
-QTEST_APPLESS_MAIN(tst_QTriangle3D)
-
-#include "tst_qtriangle3d.moc"
diff --git a/tests/auto/threed/qvectorarray/qvectorarray.pro b/tests/auto/threed/qvectorarray/qvectorarray.pro
deleted file mode 100644
index 783fa88d..00000000
--- a/tests/auto/threed/qvectorarray/qvectorarray.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGET = tst_qvectorarray
-CONFIG += testcase
-TEMPLATE=app
-QT += testlib qt3d
-QT += opengl
-
-CONFIG += warn_on
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qvectorarray.cpp
diff --git a/tests/auto/threed/qvectorarray/tst_qvectorarray.cpp b/tests/auto/threed/qvectorarray/tst_qvectorarray.cpp
deleted file mode 100644
index 74c6e389..00000000
--- a/tests/auto/threed/qvectorarray/tst_qvectorarray.cpp
+++ /dev/null
@@ -1,664 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtGui/qmatrix4x4.h>
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include "qvector4darray.h"
-#include "qtest_helpers.h"
-
-class tst_QVectorArray : public QObject
-{
- Q_OBJECT
-public:
- tst_QVectorArray() {}
- ~tst_QVectorArray() {}
-
-private slots:
- void create2DArray();
- void create3DArray();
- void create4DArray();
-
- void scale_data();
- void scale();
-
- void translateVector_data();
- void translateVector();
-
- void translateExplicit_data();
- void translateExplicit();
-
- void transform();
-};
-
-void tst_QVectorArray::create2DArray()
-{
- QVector2DArray array;
- QVERIFY(array.isEmpty());
-
- array.append(1.0f, 2.0f);
- array.append(3.0f, 4.0f);
- array.append(QVector2D(5.0f, 6.0f));
- array.append(QPointF(7.0f, 8.0f));
- array.append(QPoint(9, 10));
-
- QCOMPARE(array.size(), 5);
- QVERIFY(array[0] == QVector2D(1.0f, 2.0f));
- QVERIFY(array[1] == QVector2D(3.0f, 4.0f));
- QVERIFY(array[2] == QVector2D(5.0f, 6.0f));
- QVERIFY(array[3] == QVector2D(7.0f, 8.0f));
- QVERIFY(array[4] == QVector2D(9.0f, 10.0f));
-
- array.append(QVector2D(11.0f, 12.0f), QVector2D(13.0f, 14.0f));
- array.append(QVector2D(15.0f, 16.0f), QVector2D(17.0f, 18.0f),
- QVector2D(19.0f, 20.0f));
- array.append(QVector2D(21.0f, 22.0f), QVector2D(23.0f, 24.0f),
- QVector2D(25.0f, 26.0f));
-
- for (int index = 0; index < array.size(); ++index)
- QVERIFY(array[index] == QVector2D(index * 2 + 1, index * 2 + 2));
-
- QVector2DArray array2(34);
- QCOMPARE(array2.size(), 34);
- for (int index = 0; index < array2.size(); ++index)
- QCOMPARE(array2[index], QVector2D(0.0f, 0.0f));
-
- QVector2DArray array3(15, QVector2D(1.0f, 2.0f));
- QCOMPARE(array3.size(), 15);
- for (int index = 0; index < array3.size(); ++index)
- QCOMPARE(array3[index], QVector2D(1.0f, 2.0f));
-}
-
-void tst_QVectorArray::create3DArray()
-{
- QVector3DArray array;
- QVERIFY(array.isEmpty());
-
- array.append(1.0f, 2.0f, 3.0f);
- array.append(3.0f, 4.0f, 5.0f);
- array.append(QVector3D(5.0f, 6.0f, 7.0f));
-
- QCOMPARE(array.size(), 3);
- QVERIFY(array[0] == QVector3D(1.0f, 2.0f, 3.0f));
- QVERIFY(array[1] == QVector3D(3.0f, 4.0f, 5.0f));
- QVERIFY(array[2] == QVector3D(5.0f, 6.0f, 7.0f));
-
- array.append(QVector3D(7.0f, 8.0f, 9.0f),
- QVector3D(9.0f, 10.0f, 11.0f));
- array.append(QVector3D(11.0f, 12.0f, 13.0f),
- QVector3D(13.0f, 14.0f, 15.0f),
- QVector3D(15.0f, 16.0f, 17.0f));
- array.append(QVector3D(17.0f, 18.0f, 19.0f),
- QVector3D(19.0f, 20.0f, 21.0f),
- QVector3D(21.0f, 22.0f, 23.0f));
-
- for (int index = 0; index < array.size(); ++index) {
- QVERIFY(array[index] == QVector3D(index * 2 + 1,
- index * 2 + 2,
- index * 2 + 3));
- }
-
- QVector3DArray array2(34);
- QCOMPARE(array2.size(), 34);
- for (int index = 0; index < array2.size(); ++index)
- QCOMPARE(array2[index], QVector3D(0.0f, 0.0f, 0.0f));
-
- QVector3DArray array3(15, QVector3D(1.0f, 2.0f, 3.0f));
- QCOMPARE(array3.size(), 15);
- for (int index = 0; index < array3.size(); ++index)
- QCOMPARE(array3[index], QVector3D(1.0f, 2.0f, 3.0f));
-}
-
-void tst_QVectorArray::create4DArray()
-{
- QVector4DArray array;
- QVERIFY(array.isEmpty());
-
- array.append(1.0f, 2.0f, 3.0f, 4.0f);
- array.append(3.0f, 4.0f, 5.0f, 6.0f);
- array.append(QVector4D(5.0f, 6.0f, 7.0f, 8.0f));
-
- QCOMPARE(array.size(), 3);
- QVERIFY(array[0] == QVector4D(1.0f, 2.0f, 3.0f, 4.0f));
- QVERIFY(array[1] == QVector4D(3.0f, 4.0f, 5.0f, 6.0f));
- QVERIFY(array[2] == QVector4D(5.0f, 6.0f, 7.0f, 8.0f));
-
- array.append(QVector4D(7.0f, 8.0f, 9.0f, 10.0f),
- QVector4D(9.0f, 10.0f, 11.0f, 12.0f));
- array.append(QVector4D(11.0f, 12.0f, 13.0f, 14.0f),
- QVector4D(13.0f, 14.0f, 15.0f, 16.0f),
- QVector4D(15.0f, 16.0f, 17.0f, 18.0f));
- array.append(QVector4D(17.0f, 18.0f, 19.0f, 20.0f),
- QVector4D(19.0f, 20.0f, 21.0f, 22.0f),
- QVector4D(21.0f, 22.0f, 23.0f, 24.0f));
-
- for (int index = 0; index < array.size(); ++index) {
- QVERIFY(array[index] == QVector4D(index * 2 + 1,
- index * 2 + 2,
- index * 2 + 3,
- index * 2 + 4));
- }
-
- QVector4DArray array2(34);
- QCOMPARE(array2.size(), 34);
- for (int index = 0; index < array2.size(); ++index)
- QCOMPARE(array2[index], QVector4D(0.0f, 0.0f, 0.0f, 0.0f));
-
- QVector4DArray array3(15, QVector4D(1.0f, 2.0f, 3.0f, 4.0f));
- QCOMPARE(array3.size(), 15);
- for (int index = 0; index < array3.size(); ++index)
- QCOMPARE(array3[index], QVector4D(1.0f, 2.0f, 3.0f, 4.0f));
-}
-
-void tst_QVectorArray::scale_data()
-{
- QTest::addColumn<qreal>("scale");
-
- QTest::newRow("zero") << qreal(0.0f);
- QTest::newRow("one") << qreal(1.0f);
- QTest::newRow("neg-one") << qreal(-1.0f);
- QTest::newRow("two") << qreal(2.0f);
- QTest::newRow("neg-two-point-five") << qreal(-2.5f);
- QTest::newRow("half") << qreal(0.5f);
-}
-
-void tst_QVectorArray::scale()
-{
- QFETCH(qreal, scale);
-
- QVector2DArray v2array;
- QVector3DArray v3array;
- QVector4DArray v4array;
- QVector2DArray v2arrayb;
- QVector3DArray v3arrayb;
- QVector4DArray v4arrayb;
-
- for (int index = 0; index < 64; ++index) {
- v2array.append(index * 4, index * 4 + 1);
- v3array.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4array.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- v2arrayb.append(index * 4, index * 4 + 1);
- v3arrayb.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4arrayb.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- }
-
- // Perform a simple in-place scale.
-
- v2array.scale(scale);
- v3array.scale(scale);
- v4array.scale(scale);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) * scale, (index * 4 + 1) * scale));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale, (index * 4 + 3) * scale));
- }
-
- // Increase ref-count on an array and check that detach occurs.
-
- v2array = v2arrayb;
- v3array = v3arrayb;
- v4array = v4arrayb;
-
- QVERIFY(v2array.constData() == v2arrayb.constData());
- QVERIFY(v3array.constData() == v3arrayb.constData());
- QVERIFY(v4array.constData() == v4arrayb.constData());
-
- v2array.scale(scale);
- v3array.scale(scale);
- v4array.scale(scale);
-
- QVERIFY(v2array.constData() != v2arrayb.constData());
- QVERIFY(v3array.constData() != v3arrayb.constData());
- QVERIFY(v4array.constData() != v4arrayb.constData());
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) * scale, (index * 4 + 1) * scale));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale, (index * 4 + 3) * scale));
- QCOMPARE(v2arrayb[index],
- QVector2D(index * 4, index * 4 + 1));
- QCOMPARE(v3arrayb[index],
- QVector3D(index * 4, index * 4 + 1, index * 4 + 2));
- QCOMPARE(v4arrayb[index],
- QVector4D(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
-
- // Perform the test again, with scaled() this time.
-
- v2array = v2arrayb.scaled(scale);
- v3array = v3arrayb.scaled(scale);
- v4array = v4arrayb.scaled(scale);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) * scale, (index * 4 + 1) * scale));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) * scale, (index * 4 + 1) * scale,
- (index * 4 + 2) * scale, (index * 4 + 3) * scale));
- QCOMPARE(v2arrayb[index],
- QVector2D(index * 4, index * 4 + 1));
- QCOMPARE(v3arrayb[index],
- QVector3D(index * 4, index * 4 + 1, index * 4 + 2));
- QCOMPARE(v4arrayb[index],
- QVector4D(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
-}
-
-void tst_QVectorArray::translateVector_data()
-{
- QTest::addColumn<QVector4D>("translation");
-
- QTest::newRow("zero") << QVector4D(0.0f, 0.0f, 0.0f, 0.0f);
- QTest::newRow("x-axis") << QVector4D(1.0f, 0.0f, 0.0f, 0.0f);
- QTest::newRow("y-axis") << QVector4D(0.0f, 1.0f, 0.0f, 0.0f);
- QTest::newRow("z-axis") << QVector4D(0.0f, 0.0f, 1.0f, 0.0f);
- QTest::newRow("w-axis") << QVector4D(0.0f, 0.0f, 0.0f, 1.0f);
- QTest::newRow("all-axes") << QVector4D(1.0f, -2.0f, 3.5f, -1.5f);
-}
-
-void tst_QVectorArray::translateVector()
-{
- QFETCH(QVector4D, translation);
-
- QVector2DArray v2array;
- QVector3DArray v3array;
- QVector4DArray v4array;
- QVector2DArray v2arrayb;
- QVector3DArray v3arrayb;
- QVector4DArray v4arrayb;
-
- for (int index = 0; index < 64; ++index) {
- v2array.append(index * 4, index * 4 + 1);
- v3array.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4array.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- v2arrayb.append(index * 4, index * 4 + 1);
- v3arrayb.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4arrayb.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- }
-
- // Perform a simple in-place translate.
-
- v2array.translate(translation.toVector2D());
- v3array.translate(translation.toVector3D());
- v4array.translate(translation);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y()));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z()));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z(),
- (index * 4 + 3) + translation.w()));
- }
-
- // Increase ref-count on an array and check that detach occurs.
-
- v2array = v2arrayb;
- v3array = v3arrayb;
- v4array = v4arrayb;
-
- QVERIFY(v2array.constData() == v2arrayb.constData());
- QVERIFY(v3array.constData() == v3arrayb.constData());
- QVERIFY(v4array.constData() == v4arrayb.constData());
-
- v2array.translate(translation.toVector2D());
- v3array.translate(translation.toVector3D());
- v4array.translate(translation);
-
- QVERIFY(v2array.constData() != v2arrayb.constData());
- QVERIFY(v3array.constData() != v3arrayb.constData());
- QVERIFY(v4array.constData() != v4arrayb.constData());
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y()));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z()));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z(),
- (index * 4 + 3) + translation.w()));
- QCOMPARE(v2arrayb[index],
- QVector2D(index * 4, index * 4 + 1));
- QCOMPARE(v3arrayb[index],
- QVector3D(index * 4, index * 4 + 1, index * 4 + 2));
- QCOMPARE(v4arrayb[index],
- QVector4D(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
-
- // Perform the test again, with translated() this time.
-
- v2array = v2arrayb.translated(translation.toVector2D());
- v3array = v3arrayb.translated(translation.toVector3D());
- v4array = v4arrayb.translated(translation);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y()));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z()));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z(),
- (index * 4 + 3) + translation.w()));
- QCOMPARE(v2arrayb[index],
- QVector2D(index * 4, index * 4 + 1));
- QCOMPARE(v3arrayb[index],
- QVector3D(index * 4, index * 4 + 1, index * 4 + 2));
- QCOMPARE(v4arrayb[index],
- QVector4D(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
-}
-
-void tst_QVectorArray::translateExplicit_data()
-{
- translateVector_data();
-}
-
-void tst_QVectorArray::translateExplicit()
-{
- QFETCH(QVector4D, translation);
-
- QVector2DArray v2array;
- QVector3DArray v3array;
- QVector4DArray v4array;
- QVector2DArray v2arrayb;
- QVector3DArray v3arrayb;
- QVector4DArray v4arrayb;
-
- for (int index = 0; index < 64; ++index) {
- v2array.append(index * 4, index * 4 + 1);
- v3array.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4array.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- v2arrayb.append(index * 4, index * 4 + 1);
- v3arrayb.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4arrayb.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- }
-
- // Perform a simple in-place translate.
-
- v2array.translate(translation.x(), translation.y());
- v3array.translate(translation.x(), translation.y(), translation.z());
- v4array.translate(translation.x(), translation.y(),
- translation.z(), translation.w());
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y()));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z()));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z(),
- (index * 4 + 3) + translation.w()));
- }
-
- // Perform the test again, with translated() this time.
-
- v2array = v2arrayb.translated(translation.x(), translation.y());
- v3array = v3arrayb.translated(translation.x(), translation.y(),
- translation.z());
- v4array = v4arrayb.translated(translation.x(), translation.y(),
- translation.z(), translation.w());
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QCOMPARE(v2array[index],
- QVector2D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y()));
- QCOMPARE(v3array[index],
- QVector3D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z()));
- QCOMPARE(v4array[index],
- QVector4D((index * 4) + translation.x(),
- (index * 4 + 1) + translation.y(),
- (index * 4 + 2) + translation.z(),
- (index * 4 + 3) + translation.w()));
- QCOMPARE(v2arrayb[index],
- QVector2D(index * 4, index * 4 + 1));
- QCOMPARE(v3arrayb[index],
- QVector3D(index * 4, index * 4 + 1, index * 4 + 2));
- QCOMPARE(v4arrayb[index],
- QVector4D(index * 4, index * 4 + 1,
- index * 4 + 2, index * 4 + 3));
- }
-}
-
-static bool fuzzyCompare(const QVector2D &v1, const QVector2D &v2)
-{
- return qAbs(v1.x() - v2.x()) <= 0.00001 &&
- qAbs(v1.y() - v2.y()) <= 0.00001;
-}
-
-static bool fuzzyCompare(const QVector3D &v1, const QVector3D &v2)
-{
- return qAbs(v1.x() - v2.x()) <= 0.00001 &&
- qAbs(v1.y() - v2.y()) <= 0.00001 &&
- qAbs(v1.z() - v2.z()) <= 0.00001;
-}
-
-static bool fuzzyCompare(const QVector4D &v1, const QVector4D &v2)
-{
- return qAbs(v1.x() - v2.x()) <= 0.00001 &&
- qAbs(v1.y() - v2.y()) <= 0.00001 &&
- qAbs(v1.z() - v2.z()) <= 0.00001 &&
- qAbs(v1.w() - v2.w()) <= 0.00001;
-}
-
-void tst_QVectorArray::transform()
-{
- QMatrix4x4 m;
- m.translate(-1.0f, 2.5f, 5.0f);
- m.rotate(45.0f, 1.0f, 1.0f, 1.0f);
- m.scale(23.5f);
-
- QVector2DArray v2array;
- QVector3DArray v3array;
- QVector4DArray v4array;
- QVector2DArray v2arrayb;
- QVector3DArray v3arrayb;
- QVector4DArray v4arrayb;
-
- for (int index = 0; index < 64; ++index) {
- v2array.append(index * 4, index * 4 + 1);
- v3array.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4array.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- v2arrayb.append(index * 4, index * 4 + 1);
- v3arrayb.append(index * 4, index * 4 + 1, index * 4 + 2);
- v4arrayb.append(index * 4, index * 4 + 1, index * 4 + 2,
- index * 4 + 3);
- }
-
- // Perform a simple in-place transform.
-
- v2array.transform(m);
- v3array.transform(m);
- v4array.transform(m);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QVector2D v2(index * 4, index * 4 + 1);
- QVector3D v3(index * 4, index * 4 + 1, index * 4 + 2);
- QVector4D v4(index * 4, index * 4 + 1, index * 4 + 2, index * 4 + 3);
- QVERIFY(fuzzyCompare(v2array[index], (m * QVector3D(v2)).toVector2D()));
- QVERIFY(fuzzyCompare(v3array[index], m * v3));
- QVERIFY(fuzzyCompare(v4array[index], m * v4));
- }
-
- // Increase ref-count on an array and check that detach occurs.
-
- v2array = v2arrayb;
- v3array = v3arrayb;
- v4array = v4arrayb;
-
- QVERIFY(v2array.constData() == v2arrayb.constData());
- QVERIFY(v3array.constData() == v3arrayb.constData());
- QVERIFY(v4array.constData() == v4arrayb.constData());
-
- v2array.transform(m);
- v3array.transform(m);
- v4array.transform(m);
-
- QVERIFY(v2array.constData() != v2arrayb.constData());
- QVERIFY(v3array.constData() != v3arrayb.constData());
- QVERIFY(v4array.constData() != v4arrayb.constData());
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QVector2D v2(index * 4, index * 4 + 1);
- QVector3D v3(index * 4, index * 4 + 1, index * 4 + 2);
- QVector4D v4(index * 4, index * 4 + 1, index * 4 + 2, index * 4 + 3);
- QVERIFY(fuzzyCompare(v2array[index], (m * QVector3D(v2)).toVector2D()));
- QVERIFY(fuzzyCompare(v3array[index], m * v3));
- QVERIFY(fuzzyCompare(v4array[index], m * v4));
- QVERIFY(fuzzyCompare(v2arrayb[index], v2));
- QVERIFY(fuzzyCompare(v3arrayb[index], v3));
- QVERIFY(fuzzyCompare(v4arrayb[index], v4));
- }
-
- // Perform the test again, with translated() this time.
-
- v2array = v2arrayb.transformed(m);
- v3array = v3arrayb.transformed(m);
- v4array = v4arrayb.transformed(m);
-
- QCOMPARE(v2array.size(), 64);
- QCOMPARE(v3array.size(), 64);
- QCOMPARE(v4array.size(), 64);
-
- for (int index = 0; index < 64; ++index) {
- QVector2D v2(index * 4, index * 4 + 1);
- QVector3D v3(index * 4, index * 4 + 1, index * 4 + 2);
- QVector4D v4(index * 4, index * 4 + 1, index * 4 + 2, index * 4 + 3);
- QVERIFY(fuzzyCompare(v2array[index], (m * QVector3D(v2)).toVector2D()));
- QVERIFY(fuzzyCompare(v3array[index], m * v3));
- QVERIFY(fuzzyCompare(v4array[index], m * v4));
- QVERIFY(fuzzyCompare(v2arrayb[index], v2));
- QVERIFY(fuzzyCompare(v3arrayb[index], v3));
- QVERIFY(fuzzyCompare(v4arrayb[index], v4));
- }
-}
-
-QTEST_APPLESS_MAIN(tst_QVectorArray)
-
-#include "tst_qvectorarray.moc"
diff --git a/tests/auto/threed/threed.pro b/tests/auto/threed/threed.pro
deleted file mode 100644
index 6b193f29..00000000
--- a/tests/auto/threed/threed.pro
+++ /dev/null
@@ -1,39 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- qareaallocator \
- qarray \
- qbox3d \
- qcolor4ub \
- qcustomdataarray \
- qgeometrydata \
- qglabstractsurface \
- qglattributedescription \
- qglattributeset \
- qglattributevalue \
- qglbezierpatches \
- qglbuilder \
- qglcamera \
- qglcameraanimation \
- qglcube \
- qglindexbuffer \
- qgllightmodel \
- qgllightparameters \
- qglmaterial \
- qglmaterialcollection \
- qglpainter \
- qglpickcolors \
- qglrender \
- qglscenenode \
- qglsection \
- qglsharedresource \
- qglsphere \
- qglvertexbundle \
- qgraphicstransform3d \
- qplane3d \
- qray3d \
- qglcylinder \
- qsphere3d \
- qtriangle3d \
- qvectorarray \
- load_model \
- qglcolladafxeffectfactory
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
deleted file mode 100644
index 6c00e7ae..00000000
--- a/tests/benchmarks/benchmarks.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = qarray \
- qglbuilder_perf
-contains(QT_CONFIG, declarative):SUBDIRS += matrix_properties
diff --git a/tests/benchmarks/matrix_properties/data/CustomObject.qml b/tests/benchmarks/matrix_properties/data/CustomObject.qml
deleted file mode 100644
index 1fa2c474..00000000
--- a/tests/benchmarks/matrix_properties/data/CustomObject.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 Qt 4.7
-
-QtObject {
- property variant variantProp: 0
-}
diff --git a/tests/benchmarks/matrix_properties/data/matrix_component.qml b/tests/benchmarks/matrix_properties/data/matrix_component.qml
deleted file mode 100644
index 4611ca1b..00000000
--- a/tests/benchmarks/matrix_properties/data/matrix_component.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 Qt 4.7
-import Qt3D 1.0
-
-Item {
- CustomObject { id: theObject }
- property real scaleX : 1.0
- property real scaleY : 1.0
- property real scaleZ : 1.0
- property real translationX : 1.0
- property real translationY : 1.0
- property real translationZ : 1.0
- property real unboundReal : 1.0
-
- property real variableBoundToMatrix : 1.0
- property real variableBoundToVariantList : 1.0
-
- property variant matrixWithBoundVariable : Qt3D.matrix4x4 (
- 1.0, 0.0, 0.0, variableBoundToMatrix,
- 0.0, 1.0, 0.0, 1.0,
- 0.0, 0.0, 1.0, 1.0,
- 0.0, 0.0, 0.0, 1.0 );
-
- property variant variantListWithBoundVariable : [
- 1.0, 0.0, 0.0, variableBoundToVariantList,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 ];
-
-
- function createMatrix4x4WithConstants()
- {
- theObject.variantProp = 0;
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp = Qt3d.matrix4x4(
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 );
- }
-
- function createOneMatrix4x4WithConstants()
- {
- theObject.variantProp = 0;
- theObject.variantProp = Qt3d.matrix4x4(
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 );
- }
-
- function createMatrix4x4WithVariables()
- {
- theObject.variantProp = 0;
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp = Qt3d.matrix4x4 (
- scaleX, 0.0, 0.0, translationX,
- 0.0, scaleY, 0.0, translationY,
- 0.0, 0.0, scaleY, translationZ,
- 0.0, 0.0, 0.0, 1.0 );
- }
-
- function createOneMatrix4x4WithVariables()
- {
- theObject.variantProp = 0;
- theObject.variantProp = Qt3d.matrix4x4 (
- scaleX, 0.0, 0.0, translationX,
- 0.0, scaleY, 0.0, translationY,
- 0.0, 0.0, scaleY, translationZ,
- 0.0, 0.0, 0.0, 1.0 );
- }
-
- function createVariantListWithConstants()
- {
- theObject.variantProp = 0;
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp = [
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 ];
- }
-
- function createOneVariantListWithConstants()
- {
- theObject.variantProp = 0;
- theObject.variantProp = [
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 ];
- }
-
- function createVariantListWithVariables() {
- theObject.variantProp = 0;
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp = [
- scalex, 0.0, 0.0, translationX,
- 0.0, scaley, 0.0, translationY,
- 0.0, 0.0, scalez, translationZ,
- 0.0, 0.0, 0.0, 1.0 ];
- }
-
- function createOneVariantListWithVariables() {
- theObject.variantProp = 0;
- theObject.variantProp = [
- scalex, 0.0, 0.0, translationX,
- 0.0, scaley, 0.0, translationY,
- 0.0, 0.0, scalez, translationZ,
- 0.0, 0.0, 0.0, 1.0 ];
- }
-
- function modifyMatrix4x4() {
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp.m(2,3) = 1.0;
- }
-
- function modifyVariantList() {
- for (var i = 0; i < 1000; ++i)
- theObject.variantProp[4] = 2.0;
- }
-
- function modifyBoundVariable() {
- translationX += 0.1;
- }
-
- function modifyUnboundVariable() {
- unboundReal += 0.1;
- }
-
-}
diff --git a/tests/benchmarks/matrix_properties/matrix_properties.pro b/tests/benchmarks/matrix_properties/matrix_properties.pro
deleted file mode 100644
index 10df68be..00000000
--- a/tests/benchmarks/matrix_properties/matrix_properties.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = app
-TARGET = tst_matrix_properties
-QT += declarative testlib
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_matrix_properties.cpp
-
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-
-
-
diff --git a/tests/benchmarks/matrix_properties/tst_matrix_properties.cpp b/tests/benchmarks/matrix_properties/tst_matrix_properties.cpp
deleted file mode 100644
index 517cd024..00000000
--- a/tests/benchmarks/matrix_properties/tst_matrix_properties.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QDeclarativeEngine>
-#include <QDeclarativeComponent>
-
-class tst_matrix_properties : public QObject
-{
- Q_OBJECT
-public:
- tst_matrix_properties() {}
-
-private slots:
- void initTestCase();
-
- void create_data();
- void create();
-
- void modify_data();
- void modify();
-
- void boundVariableChange_data();
- void boundVariableChange();
-
-// TODO:
-// void assign();
-
-private:
-};
-
-inline QUrl TEST_FILE(const char *filename)
-{
- return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + QLatin1String(filename));
-}
-
-void tst_matrix_properties::initTestCase()
-{
-}
-
-void tst_matrix_properties::create_data()
-{
- QTest::addColumn<QString>("methodName");
- QTest::newRow("createMatrix4x4WithConstants") << "createMatrix4x4WithConstants()";
- QTest::newRow("createMatrix4x4WithVariables") << "createMatrix4x4WithVariables()";
- QTest::newRow("createVariantListWithConstants") << "createVariantListWithConstants()";
- QTest::newRow("createVariantListWithVariables") << "createVariantListWithVariables()";
-}
-
-void tst_matrix_properties::create()
-{
- QFETCH(QString, methodName);
- QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, TEST_FILE("matrix_component.qml"));
- QObject *item = component.create();
-
- QVERIFY(item != 0);
-
- int index = item->metaObject()->indexOfMethod(methodName.toUtf8().constData());
- QVERIFY(index != -1);
- QMetaMethod method = item->metaObject()->method(index);
-
- QBENCHMARK {
- method.invoke(item, Qt::DirectConnection);
- }
-
- delete item;
-}
-
-void tst_matrix_properties::modify_data()
-{
- QTest::addColumn<QString>("initMethodName");
- QTest::addColumn<QString>("methodName");
- QTest::newRow("modifyMatrix4x4") << "createOneMatrix4x4WithConstants()"
- << "modifyMatrix4x4()";
- QTest::newRow("modifyVariantList") << "createOneVariantListWithConstants()"
- << "modifyVariantList()";
-}
-
-void tst_matrix_properties::modify()
-{
- QFETCH(QString, initMethodName);
- QFETCH(QString, methodName);
- QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, TEST_FILE("matrix_component.qml"));
- QObject *item = component.create();
-
- QVERIFY(item != 0);
-
- // Set the test property to a matrix or variantlist as appropriate.
- int index = item->metaObject()->indexOfMethod(initMethodName.toUtf8().constData());
- QVERIFY(index != -1);
- QMetaMethod method = item->metaObject()->method(index);
- method.invoke(item, Qt::DirectConnection);
-
- index = item->metaObject()->indexOfMethod(methodName.toUtf8().constData());
- QVERIFY(index != -1);
- method = item->metaObject()->method(index);
-
- QBENCHMARK {
- method.invoke(item, Qt::DirectConnection);
- }
-
- delete item;
-}
-
-void tst_matrix_properties::boundVariableChange_data()
-{
- QTest::addColumn<QString>("propertyName");
- QTest::newRow("UnboundVariable")
- << "unboundReal";
- QTest::newRow("BoundOnMatrix")
- << "variableBoundToMatrix";
- QTest::newRow("BoundOnVariantList")
- << "variableBoundToVariantList";
-}
-
-void tst_matrix_properties::boundVariableChange()
-{
- QFETCH(QString, propertyName);
- QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, TEST_FILE("matrix_component.qml"));
- QObject *item = component.create();
-
- QVERIFY(item != 0);
-
- QByteArray propertyNameByteArray = propertyName.toUtf8().constData();
- qreal value = 1.0;
-
- QBENCHMARK {
- item->setProperty(propertyNameByteArray.constData(), (value += 0.1));
- }
-
- delete item;
-}
-
-QTEST_MAIN(tst_matrix_properties)
-
-#include "tst_matrix_properties.moc"
diff --git a/tests/benchmarks/qarray/qarray.pro b/tests/benchmarks/qarray/qarray.pro
deleted file mode 100644
index d83241b9..00000000
--- a/tests/benchmarks/qarray/qarray.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qarray.cpp
diff --git a/tests/benchmarks/qarray/tst_qarray.cpp b/tests/benchmarks/qarray/tst_qarray.cpp
deleted file mode 100644
index a304eae6..00000000
--- a/tests/benchmarks/qarray/tst_qarray.cpp
+++ /dev/null
@@ -1,503 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtTest/QtTest>
-#include <QtGui/qvector3d.h>
-#include <QtCore/qvarlengtharray.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qlist.h>
-#include "qarray.h"
-#ifndef QT_NO_STL
-#include <vector>
-#endif
-
-//#define TEST_QLIST 1
-
-class tst_QArray : public QObject
-{
- Q_OBJECT
-public:
- tst_QArray() {}
- virtual ~tst_QArray() {}
-
-private slots:
- void append_data();
- void append();
- void appendReserved_data();
- void appendReserved();
- void appendVector3D_data();
- void appendVector3D();
- void appendSmall_data();
- void appendSmall();
- void appendFourAtATime_data();
- void appendFourAtATime();
- void clear_data();
- void clear();
- void randomAccess_data();
- void randomAccess();
-};
-
-enum {
- Test_Vector,
- Test_List,
- Test_VarLengthArray,
- Test_Array,
- Test_STLVector
-};
-
-void tst_QArray::append_data()
-{
- QTest::addColumn<int>("size");
- QTest::addColumn<int>("type");
-
- QByteArray name;
- for (int size = 0; size < 1024; size += 12) {
- name = "QVector--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_Vector);
-
-#if TEST_QLIST
- name = "QList--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_List);
-#endif
-
- name = "QVarLengthArray--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_VarLengthArray);
-
- name = "QArray--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_Array);
-
-#ifndef QT_NO_STL
- name = "std::vector--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_STLVector);
-#endif
- }
-}
-
-void tst_QArray::append()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_List) {
- QList<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_Array) {
- QArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.push_back(float(i));
- }
-#endif
- }
-}
-
-void tst_QArray::appendReserved_data()
-{
- append_data();
-}
-
-void tst_QArray::appendReserved()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<float> buffer;
- buffer.reserve(size);
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_List) {
- QList<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<float> buffer;
- buffer.reserve(size);
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_Array) {
- QArray<float> buffer;
- buffer.reserve(size);
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<float> buffer;
- buffer.reserve(size);
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.push_back(float(i));
- }
-#endif
- }
-}
-
-void tst_QArray::appendVector3D_data()
-{
- append_data();
-}
-
-void tst_QArray::appendVector3D()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<QVector3D> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(QVector3D(i, i + 1, i + 2));
- }
- } else if (type == Test_List) {
- QList<QVector3D> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(QVector3D(i, i + 1, i + 2));
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<QVector3D> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(QVector3D(i, i + 1, i + 2));
- }
- } else if (type == Test_Array) {
- QArray<QVector3D> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(QVector3D(i, i + 1, i + 2));
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<QVector3D> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.push_back(QVector3D(i, i + 1, i + 2));
- }
-#endif
- }
-}
-
-void tst_QArray::appendSmall_data()
-{
- QTest::addColumn<int>("size");
- QTest::addColumn<int>("type");
-
- QByteArray name;
- for (int size = 0; size < 16; ++size) {
- name = "QVector--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_Vector);
-
-#if TEST_QLIST
- name = "QList--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_List);
-#endif
-
- name = "QVarLengthArray--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_VarLengthArray);
-
- name = "QArray--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_Array);
-
-#ifndef QT_NO_STL
- name = "std::vector--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_STLVector);
-#endif
- }
-}
-
-void tst_QArray::appendSmall()
-{
- append();
-}
-
-void tst_QArray::appendFourAtATime_data()
-{
- append_data();
-}
-
-void tst_QArray::appendFourAtATime()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; i += 4) {
- buffer.append(float(i));
- buffer.append(float(i + 1));
- buffer.append(float(i + 2));
- buffer.append(float(i + 3));
- }
- }
- } else if (type == Test_List) {
- QList<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; i += 4) {
- buffer.append(float(i));
- buffer.append(float(i + 1));
- buffer.append(float(i + 2));
- buffer.append(float(i + 3));
- }
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; i += 4) {
- buffer.append(float(i));
- buffer.append(float(i + 1));
- buffer.append(float(i + 2));
- buffer.append(float(i + 3));
- }
- }
- } else if (type == Test_Array) {
- QArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; i += 4) {
- buffer.append(float(i), float(i + 1),
- float(i + 2), float(i + 3));
- }
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; i += 4) {
- buffer.push_back(float(i));
- buffer.push_back(float(i + 1));
- buffer.push_back(float(i + 2));
- buffer.push_back(float(i + 3));
- }
- }
-#endif
- }
-}
-
-void tst_QArray::clear_data()
-{
- append_data();
-}
-
-void tst_QArray::clear()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- buffer.clear();
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_List) {
- QList<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- buffer.clear();
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- buffer.clear();
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
- } else if (type == Test_Array) {
- QArray<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- buffer.resize(0);
- for (int i = 0; i < size; ++i)
- buffer.append(float(i));
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<float> buffer;
- QBENCHMARK {
- for (int i = 0; i < size; ++i)
- buffer.push_back(float(i));
- buffer.clear();
- for (int i = 0; i < size; ++i)
- buffer.push_back(float(i));
- }
-#endif
- }
-}
-
-void tst_QArray::randomAccess_data()
-{
- QTest::addColumn<int>("type");
-
- QTest::newRow("QVector") << int(Test_Vector);
-#if TEST_QLIST
- QTest::newRow("QList") << int(Test_List);
-#endif
- QTest::newRow("QVarLengthArray") << int(Test_VarLengthArray);
- QTest::newRow("QArray") << int(Test_Array);
-#ifndef QT_NO_STL
- QTest::newRow("std::vector") << int(Test_STLVector);
-#endif
-}
-
-// To force the values below to be computed and stored.
-static int volatile finalSum;
-
-void tst_QArray::randomAccess()
-{
- QFETCH(int, type);
-
- if (type == Test_Vector) {
- QVector<int> buffer;
- for (int i = 0; i < 10000; ++i)
- buffer.append(i);
- QBENCHMARK {
- for (int i = 10; i < 10000; ++i)
- buffer[i] = buffer.at(i - 10) + buffer.at(i - 4) * 2;
- int sum = 0;
- for (int i = 0; i < 10000; ++i)
- sum += buffer.at(i);
- finalSum = sum;
- }
- } else if (type == Test_List) {
- QList<int> buffer;
- for (int i = 0; i < 10000; ++i)
- buffer.append(i);
- QBENCHMARK {
- for (int i = 10; i < 10000; ++i)
- buffer[i] = buffer[i - 10] + buffer[i - 4] * 2;
- int sum = 0;
- for (int i = 0; i < 10000; ++i)
- sum += buffer[i];
- finalSum = sum;
- }
- } else if (type == Test_VarLengthArray) {
- QVarLengthArray<int> buffer;
- for (int i = 0; i < 10000; ++i)
- buffer.append(i);
- QBENCHMARK {
- for (int i = 10; i < 10000; ++i)
- buffer[i] = buffer[i - 10] + buffer[i - 4] * 2;
- int sum = 0;
- for (int i = 0; i < 10000; ++i)
- sum += buffer[i];
- finalSum = sum;
- }
- } else if (type == Test_Array) {
- QArray<int> buffer;
- for (int i = 0; i < 10000; ++i)
- buffer.append(i);
- QBENCHMARK {
- for (int i = 10; i < 10000; ++i)
- buffer[i] = buffer.at(i - 10) + buffer.at(i - 4) * 2;
- int sum = 0;
- for (int i = 0; i < 10000; ++i)
- sum += buffer.at(i);
- finalSum = sum;
- }
-#ifndef QT_NO_STL
- } else if (type == Test_STLVector) {
- std::vector<int> buffer;
- for (int i = 0; i < 10000; ++i)
- buffer.push_back(i);
- QBENCHMARK {
- for (int i = 10; i < 10000; ++i)
- buffer[i] = buffer[i - 10] + buffer[i - 4] * 2;
- int sum = 0;
- for (int i = 0; i < 10000; ++i)
- sum += buffer[i];
- finalSum = sum;
- }
-#endif
- }
-}
-
-QTEST_MAIN(tst_QArray)
-
-#include "tst_qarray.moc"
diff --git a/tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro b/tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro
deleted file mode 100644
index e3aa1485..00000000
--- a/tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE=app
-QT += testlib qt3d
-CONFIG += warn_on
-
-SOURCES += tst_qglbuilder_perf.cpp
-INCLUDEPATH += $$QT.qt3d.sources/geometry
diff --git a/tests/benchmarks/qglbuilder_perf/tst_qglbuilder_perf.cpp b/tests/benchmarks/qglbuilder_perf/tst_qglbuilder_perf.cpp
deleted file mode 100644
index 4667297a..00000000
--- a/tests/benchmarks/qglbuilder_perf/tst_qglbuilder_perf.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <ctime>
-#include <QtTest/QtTest>
-#include "qglbuilder.h"
-#include "qglteapot.h"
-#include "qglsection_p.h"
-#include "qgeometrydata.h"
-
-class TestBuilder : public QGLBuilder
-{
-public:
- QGLSection *section() { return currentSection(); }
- void setDefThreshold(int t) { setDefaultThreshold(t); }
-};
-
-class tst_QGLBuilder : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLBuilder() {}
- virtual ~tst_QGLBuilder() {}
- void addQuadBenchMarks(const QVector3DArray &data, int type);
-
-private slots:
- void addQuadRandom_data();
- void addQuadRandom();
- void addQuadOrdered_data();
- void addQuadOrdered();
- void teapot();
-};
-
-enum {
- Test_3,
- Test_7,
- Test_10,
- Test_20
-};
-
-void tst_QGLBuilder::addQuadRandom_data()
-{
- QTest::addColumn<int>("size");
- QTest::addColumn<int>("type");
-
- QByteArray name;
- for (int size = 10; size < 10000; size += 10)
- {
- name = "T3--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_3);
-
- name = "T7--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_7);
-
- name = "T10--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_10);
-
- name = "T20--";
- name += QByteArray::number(size);
- QTest::newRow(name.constData()) << size << int(Test_20);
- }
-}
-
-static inline qreal randCoord()
-{
- return (200.0f * ((qreal)qrand() / (qreal)RAND_MAX)) - 100.0f;
-}
-
-QVector3D randVector()
-{
- static bool seeded = false;
- if (!seeded)
- {
- qsrand(time(0));
- seeded = true;
- }
- return QVector3D(randCoord(), randCoord(), randCoord());
-}
-
-void tst_QGLBuilder::addQuadRandom()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- int n = qSqrt(size);
- size = n * n;
- QVector3DArray data;
- data.reserve(size);
- for (int i = 0; i < size; ++i)
- {
- // make sure (in face of randomness) we get a planar quad
- QVector3D origin = randVector();
- QVector3D a;
- while (a.isNull())
- a = randVector();
- QVector3D b;
- while (b.isNull())
- b = randVector();
- data.append(origin, a, a+b, b);
- }
- addQuadBenchMarks(data, type);
-}
-
-void tst_QGLBuilder::addQuadBenchMarks(const QVector3DArray &data, int type)
-{
- int size = data.size();
- if (type == Test_3)
- {
- QBENCHMARK {
- TestBuilder builder;
- builder.newSection(QGL::Smooth);
- builder.section()->setMapThreshold(3);
- for (int i = 0; (i+3) < size; i += 4)
- {
- QGeometryData op;
- op.appendVertex(data[i], data[i+1], data[i+2], data[i+3]);
- builder.addQuads(op);
- }
- builder.finalizedSceneNode();
- }
- }
- else if (type == Test_7)
- {
- QBENCHMARK {
- TestBuilder builder;
- builder.newSection(QGL::Smooth);
- builder.section()->setMapThreshold(7);
- for (int i = 0; (i+3) < size; i += 4)
- {
- QGeometryData op;
- op.appendVertex(data[i], data[i+1], data[i+2], data[i+3]);
- builder.addQuads(op);
- }
- builder.finalizedSceneNode();
- }
- }
- else if (type == Test_10)
- {
- QBENCHMARK {
- TestBuilder builder;
- builder.newSection(QGL::Smooth);
- builder.section()->setMapThreshold(10);
- for (int i = 0; (i+3) < size; i += 4)
- {
- QGeometryData op;
- op.appendVertex(data[i], data[i+1], data[i+2], data[i+3]);
- builder.addQuads(op);
- }
- builder.finalizedSceneNode();
- }
- }
- else if (type == Test_20)
- {
- QBENCHMARK {
- TestBuilder builder;
- builder.newSection(QGL::Smooth);
- builder.section()->setMapThreshold(20);
- for (int i = 0; (i+3) < size; i += 4)
- {
- QGeometryData op;
- op.appendVertex(data[i], data[i+1], data[i+2], data[i+3]);
- builder.addQuads(op);
- }
- builder.finalizedSceneNode();
- }
- }
-}
-
-void tst_QGLBuilder::addQuadOrdered_data()
-{
- addQuadRandom_data();
-}
-
-void tst_QGLBuilder::addQuadOrdered()
-{
- QFETCH(int, size);
- QFETCH(int, type);
-
- int n = qSqrt(size);
- size = n * n;
- QVector3DArray data;
- data.reserve(size);
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < n; ++j)
- data.append(QVector3D(1.0f * i, 1.0f * j, 0.0f),
- QVector3D(1.0f * (i+1), 1.0f * j, 0.0f),
- QVector3D(1.0f * (i+1), 1.0f * (j+1), 0.0f),
- QVector3D(1.0f * i, 1.0f * (j+1), 0.0f));
- addQuadBenchMarks(data, type);
-}
-
-void tst_QGLBuilder::teapot()
-{
- QBENCHMARK {
- QGLBuilder builder;
- builder << QGLTeapot();
- builder.finalizedSceneNode();
- }
-}
-
-
-QTEST_MAIN(tst_QGLBuilder)
-
-#include "tst_qglbuilder_perf.moc"
diff --git a/tests/manual/animations/animations.pro b/tests/manual/animations/animations.pro
deleted file mode 100644
index 1fd243f9..00000000
--- a/tests/manual/animations/animations.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_animations
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/animations/animations.qmlproject b/tests/manual/animations/animations.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/animations/animations.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/animations/icon-l-qtquick3d.png b/tests/manual/animations/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/animations/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/animations/info.json b/tests/manual/animations/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/animations/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/animations/m5-tst_animations_qml.desktop b/tests/manual/animations/m5-tst_animations_qml.desktop
deleted file mode 100644
index 0ea204c9..00000000
--- a/tests/manual/animations/m5-tst_animations_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_animations
-Comment=Qt3D test animations application
-Exec=/usr/bin/tst_animations -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/animations/main.cpp b/tests/manual/animations/main.cpp
deleted file mode 100644
index 58a72cab..00000000
--- a/tests/manual/animations/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_animations.qml")
diff --git a/tests/manual/animations/mt.qml b/tests/manual/animations/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/animations/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/animations/qml/TestCase.qml b/tests/manual/animations/qml/TestCase.qml
deleted file mode 100644
index 49f259d4..00000000
--- a/tests/manual/animations/qml/TestCase.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
- property string text;
- property variant rotationAxis : Qt.vector3d(1,0,0)
- property real defaultWidth: 220
- property real defaultHeight: 150
- property variant rotation: Rotation3D {}
-
- 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.top: textItem.bottom
- anchors.bottom: container.bottom
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- camera: Camera { eye: Qt.vector3d(0,15,50)}
- Cube
- {
- id: model
- scale: 8.0
- transform: container.rotation
- }
- }
- }
-}
diff --git a/tests/manual/animations/qml/desktop.qml b/tests/manual/animations/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/animations/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/animations/qml/tst_animations.qml b/tests/manual/animations/qml/tst_animations.qml
deleted file mode 100644
index a34477c6..00000000
--- a/tests/manual/animations/qml/tst_animations.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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-18702
-Item {
- id: screen
- width: aTestCase.defaultWidth * 3
- height: aTestCase.defaultHeight * 3
-
- Flow {
- anchors.fill: parent
-
- TestCase {
- id: aTestCase
- text: "Rotation: Z axis\n(Rolling to the left)\nNumberAnimation"
- rotationAxis: Qt.vector3d(0,0,1)
- rotation: Rotation3D {
- axis: rotationAxis
- NumberAnimation on angle {
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 1500
- }
- }
- }
-
- TestCase {
- text: "Rotation: Z axis\n(Rolling to the left)\nRotationAnimation"
- rotationAxis: Qt.vector3d(0,0,1)
- rotation: Rotation3D {
- axis: rotationAxis
- RotationAnimation on angle {
- loops: Animation.Infinite
- from: 0
- to: 359
- duration: 1500
- direction: RotationAnimation.Clockwise
- }
- }
- }
-
- TestCase {
- text: "Rotation: Z axis\n(Rolling to the left)\nSmoothedAnimation"
- rotationAxis: Qt.vector3d(0,0,1)
- rotation: Rotation3D {
- axis: rotationAxis
- SmoothedAnimation on angle {
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 1500
- velocity: 200
- }
- }
- }
-
- TestCase {
- text: "Rotation: Z axis\n(Rolling to the left)\nSpringAnimation"
- rotationAxis: Qt.vector3d(0,0,1)
- rotation: Rotation3D {
- axis: rotationAxis
- SpringAnimation on angle {
- id: rotationAnimation
- loops: Animation.Infinite
- from: 0
- to: 359
- duration: 1500
- spring: 2
- damping: 0.2
- }
- }
- }
- }
-}
diff --git a/tests/manual/animations/tst_animations_qml.desktop b/tests/manual/animations/tst_animations_qml.desktop
deleted file mode 100644
index b8aebcb4..00000000
--- a/tests/manual/animations/tst_animations_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_animations
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_animations -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_animations_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/background/background.pro b/tests/manual/background/background.pro
deleted file mode 100644
index 9908f199..00000000
--- a/tests/manual/background/background.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = app
-TARGET = tst_background
-CONFIG += qt warn_on
-QT += declarative quick
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/background/icon-l-qtquick3d.png b/tests/manual/background/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/background/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/background/main.cpp b/tests/manual/background/main.cpp
deleted file mode 100644
index 5d672540..00000000
--- a/tests/manual/background/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_background.qml")
diff --git a/tests/manual/background/qml/sky.png b/tests/manual/background/qml/sky.png
deleted file mode 100644
index 153b833c..00000000
--- a/tests/manual/background/qml/sky.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/background/qml/tst_background.qml b/tests/manual/background/qml/tst_background.qml
deleted file mode 100644
index d527c768..00000000
--- a/tests/manual/background/qml/tst_background.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Image {
- source: "sky.png"
-
- Viewport {
- width: 640
- height: 480
-
- camera: Camera {
- eye: Qt.vector3d(2,5,20);
- }
-
- picking: true
-
- Cube {
- onClicked: console.log("Cube clicked")
- effect: Effect {
- color: "#aaca00"
- }
- }
- }
-
- Text {
- id: instructionsText
- text: "Cube + back image. Drag to rotate, click & check log."
- }
-}
-
diff --git a/tests/manual/basic/README b/tests/manual/basic/README
deleted file mode 100644
index f7994e81..00000000
--- a/tests/manual/basic/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This test renders a cube against a cleared black background.
-
-The cube should be able to be manipulated by dragging the mouse
-pointer around the window.
-
-The aim is to have the simplest possible test which shows rendering
-3D content with no 2D content.
-
-When the 3D content is free of 2D QML in this way optimized approaches may
-be used and this test (along with "background") is meant to be the simplest test
-of this behavior.
diff --git a/tests/manual/basic/basic.pro b/tests/manual/basic/basic.pro
deleted file mode 100644
index 964cbc72..00000000
--- a/tests/manual/basic/basic.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = app
-TARGET = tst_basic
-CONFIG += qt warn_on
-QT += declarative quick
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/basic/icon-l-qtquick3d.png b/tests/manual/basic/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/basic/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/basic/main.cpp b/tests/manual/basic/main.cpp
deleted file mode 100644
index e62e2af6..00000000
--- a/tests/manual/basic/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_basic.qml")
diff --git a/tests/manual/basic/qml/tst_basic.qml b/tests/manual/basic/qml/tst_basic.qml
deleted file mode 100644
index 8db4d048..00000000
--- a/tests/manual/basic/qml/tst_basic.qml
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Item {
- id: screen
- width: 640
- height: 520
-
- Viewport {
- width: 640
- height: 480
- fillColor: "black"
-
- camera: Camera {eye: Qt.vector3d(0,3,20) }
- picking: true
- //showPicking: true
-
- ListModel {
- id: positionModel
- ListElement {
- x: -2.0; y: 1.8;
- color: "#CC2200";
- name_string: "top left"
- }
- ListElement {
- x: 0.0; y: 1.8;
- color: "#8822aa";
- name_string: "top middle"
- }
- ListElement {
- x: 2.0; y: 1.8;
- color: "#1122ca";
- name_string: "top right"
- }
- ListElement {
- x: -2.0; y: 0.0;
- color: "#CC8800";
- name_string: "mid left"
- }
- ListElement {
- x: 0.0; y: 0.0;
- color: "#8888aa";
- name_string: "middle"
- }
- ListElement {
- x: 2.0; y: 0.0;
- color: "#118800";
- name_string: "mid right"
- }
- ListElement {
- x: -2.0; y: -1.8;
- color: "#CCBB00";
- name_string: "bottom left"
- }
- ListElement {
- x: 0.0; y: -1.8;
- color: "#88BB00";
- name_string: "bottom middle"
- }
- ListElement {
- x: 2.0; y: -1.8;
- color: "#11BB00";
- name_string: "bottom right"
- }
- }
-
- Component {
- id: cubeComponent
- Cube {
- position: Qt.vector3d(model.x,model.y, 0.0)
- onClicked: console.log(model.name_string)
- effect: Effect {
- color: model.color
- }
- }
- }
-
- Item3D {
- Repeater {
- delegate: cubeComponent
- model: positionModel
- }
- }
- }
- Rectangle {
- id: instructions
- x: 0; y: 480
- width: screen.width
- height: 40
- color: "#3333aa"
- Text {
- id: instructionsText
- wrapMode: "WordWrap"
- text: "Pick a cube, check log output. Drag in the black area to move all cubes."
- anchors.centerIn: parent
- }
- }
-}
-
diff --git a/tests/manual/displaymodel/README b/tests/manual/displaymodel/README
deleted file mode 100644
index e22b48fd..00000000
--- a/tests/manual/displaymodel/README
+++ /dev/null
@@ -1,16 +0,0 @@
-
-This test renders a series of generated and file loaded meshes to validate functionality.
-
-The first 5 meshes are dynamically generated. They are: points, lines, sphere, cylinder, capsule.
-
-The next 2 meshes are .obj files loaded at runtime. They are: plane.obj, cube.obj.
-
-The next mesh is a .bez teapot mesh.
-
-The final mesh is a .3ds mesh of a lunar lander.
-
-All meshes should be lit & shaded, and can be manually rotated by using ctrl+leftclick and dragging.
-
-Zoom can be achieved by mouse wheel.
-
-Click each object for an "Object clicked" debug message in the debugger.
diff --git a/tests/manual/displaymodel/displaymodel.pro b/tests/manual/displaymodel/displaymodel.pro
deleted file mode 100644
index 49b36b2c..00000000
--- a/tests/manual/displaymodel/displaymodel.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_displaymodel
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/displaymodel/displaymodel.qmlproject b/tests/manual/displaymodel/displaymodel.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/displaymodel/displaymodel.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/displaymodel/icon-l-qtquick3d.png b/tests/manual/displaymodel/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/displaymodel/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/displaymodel/info.json b/tests/manual/displaymodel/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/displaymodel/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/displaymodel/main.cpp b/tests/manual/displaymodel/main.cpp
deleted file mode 100644
index a592e327..00000000
--- a/tests/manual/displaymodel/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_displaymodel.qml")
diff --git a/tests/manual/displaymodel/mt.qml b/tests/manual/displaymodel/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/displaymodel/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/displaymodel/qml/desktop.qml b/tests/manual/displaymodel/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/displaymodel/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/displaymodel/qml/meshes/lunar-lander.3ds b/tests/manual/displaymodel/qml/meshes/lunar-lander.3ds
deleted file mode 100644
index 7403fdef..00000000
--- a/tests/manual/displaymodel/qml/meshes/lunar-lander.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/displaymodel/qml/meshes/monkey.mtl b/tests/manual/displaymodel/qml/meshes/monkey.mtl
deleted file mode 100644
index 07e6051f..00000000
--- a/tests/manual/displaymodel/qml/meshes/monkey.mtl
+++ /dev/null
@@ -1,2 +0,0 @@
-# Blender MTL File: ''
-# Material Count: 0
diff --git a/tests/manual/displaymodel/qml/meshes/monkey.obj b/tests/manual/displaymodel/qml/meshes/monkey.obj
deleted file mode 100644
index 95ace968..00000000
--- a/tests/manual/displaymodel/qml/meshes/monkey.obj
+++ /dev/null
@@ -1,1013 +0,0 @@
-# Blender v2.57 (sub 1) OBJ File: ''
-# www.blender.org
-mtllib monkey.mtl
-o Monkey
-v 0.447324 0.860709 -0.155921
-v -0.427676 0.860709 -0.155921
-v 0.509824 0.782584 -0.085608
-v -0.490176 0.782584 -0.085608
-v 0.556699 0.673209 -0.046546
-v -0.537051 0.673209 -0.046546
-v 0.361386 0.712272 0.031579
-v -0.341739 0.712272 0.031579
-v 0.361386 0.813834 -0.023108
-v -0.341739 0.813834 -0.023108
-v 0.361386 0.876334 -0.124671
-v -0.341739 0.876334 -0.124671
-v 0.283261 0.891959 -0.155921
-v -0.263614 0.891959 -0.155921
-v 0.212949 0.837272 -0.085608
-v -0.193301 0.837272 -0.085608
-v 0.166074 0.743522 -0.046546
-v -0.146426 0.743522 -0.046546
-v 0.087949 0.751334 -0.234046
-v -0.068301 0.751334 -0.234046
-v 0.150449 0.837272 -0.234046
-v -0.130801 0.837272 -0.234046
-v 0.252011 0.891959 -0.234046
-v -0.232364 0.891959 -0.234046
-v 0.283261 0.891959 -0.319983
-v -0.263614 0.891959 -0.319983
-v 0.212949 0.837272 -0.382483
-v -0.193301 0.837272 -0.382483
-v 0.166074 0.743522 -0.429358
-v -0.146426 0.743522 -0.429358
-v 0.361386 0.712272 -0.507483
-v -0.341739 0.712272 -0.507483
-v 0.361386 0.813834 -0.444983
-v -0.341739 0.813834 -0.444983
-v 0.361386 0.876334 -0.351233
-v -0.341739 0.876334 -0.351233
-v 0.447324 0.860709 -0.319983
-v -0.427676 0.860709 -0.319983
-v 0.509824 0.782584 -0.382483
-v -0.490176 0.782584 -0.382483
-v 0.556699 0.673209 -0.429358
-v -0.537051 0.673209 -0.429358
-v 0.634824 0.657584 -0.234046
-v -0.615176 0.657584 -0.234046
-v 0.572324 0.766959 -0.234046
-v -0.552676 0.766959 -0.234046
-v 0.478574 0.852897 -0.234046
-v -0.458926 0.852897 -0.234046
-v 0.486386 0.868522 -0.234046
-v -0.466739 0.868522 -0.234046
-v 0.455136 0.876334 -0.327796
-v -0.435489 0.876334 -0.327796
-v 0.361386 0.899772 -0.366858
-v -0.341739 0.899772 -0.366858
-v 0.275449 0.915397 -0.327796
-v -0.255801 0.915397 -0.327796
-v 0.236386 0.915397 -0.234046
-v -0.216739 0.915397 -0.234046
-v 0.275449 0.915397 -0.148108
-v -0.255801 0.915397 -0.148108
-v 0.361386 0.923209 -0.234046
-v -0.341739 0.923209 -0.234046
-v 0.361386 0.899772 -0.109046
-v -0.341739 0.899772 -0.109046
-v 0.455136 0.876334 -0.148108
-v -0.435489 0.876334 -0.148108
-v 0.009824 0.837272 -0.421546
-v 0.009824 0.915397 -0.343421
-v 0.009824 0.829459 0.687829
-v 0.009824 0.876334 0.328454
-v 0.009824 0.891959 0.195642
-v 0.009824 0.813834 0.781579
-v 0.009824 0.696647 -0.398108
-v 0.009824 0.665397 -0.562171
-v 0.009824 -0.451791 -0.890296
-v 0.009824 -0.756478 -0.554358
-v 0.009824 -0.733041 -0.062171
-v 0.009824 -0.256478 0.390954
-v 0.212949 0.657584 0.195642
-v -0.193301 0.657584 0.195642
-v 0.322324 0.665397 0.445642
-v -0.302676 0.665397 0.445642
-v 0.361386 0.665397 0.703454
-v -0.341739 0.665397 0.703454
-v 0.377011 0.626334 0.898767
-v -0.357364 0.626334 0.898767
-v 0.337949 0.618522 0.953454
-v -0.318301 0.618522 0.953454
-v 0.189511 0.649772 0.976892
-v -0.169864 0.649772 0.976892
-v 0.009824 0.673209 0.992517
-v 0.447324 0.626334 0.148767
-v -0.427676 0.626334 0.148767
-v 0.642636 0.634147 0.047204
-v -0.622989 0.634147 0.047204
-v 0.837949 0.540397 -0.140296
-v -0.818301 0.540397 -0.140296
-v 0.869199 0.688834 -0.421546
-v -0.849551 0.688834 -0.421546
-v 0.720761 0.720084 -0.476233
-v -0.701114 0.720084 -0.476233
-v 0.502011 0.782584 -0.593421
-v -0.482364 0.782584 -0.593421
-v 0.330136 0.829459 -0.749671
-v -0.310489 0.829459 -0.749671
-v 0.166074 0.852897 -0.710608
-v -0.146426 0.852897 -0.710608
-v 0.072324 0.845084 -0.484046
-v -0.052676 0.845084 -0.484046
-v 0.173886 0.868522 -0.405921
-v -0.154239 0.868522 -0.405921
-v 0.134824 0.860709 -0.296546
-v -0.115176 0.860709 -0.296546
-v 0.212949 0.837272 -0.085608
-v -0.193301 0.837272 -0.085608
-v 0.384824 0.798209 -0.007483
-v -0.365176 0.798209 -0.007483
-v 0.502011 0.766959 -0.054358
-v -0.482364 0.766959 -0.054358
-v 0.634824 0.743522 -0.179358
-v -0.615176 0.743522 -0.179358
-v 0.650449 0.743522 -0.288733
-v -0.630801 0.743522 -0.288733
-v 0.611386 0.759147 -0.366858
-v -0.591739 0.759147 -0.366858
-v 0.439511 0.813834 -0.429358
-v -0.419864 0.813834 -0.429358
-v 0.259824 0.852897 -0.460608
-v -0.240176 0.852897 -0.460608
-v 0.009824 0.829459 0.773767
-v 0.119199 0.829459 0.726892
-v -0.099551 0.829459 0.726892
-v 0.127011 0.806022 0.844079
-v -0.107364 0.806022 0.844079
-v 0.072324 0.790397 0.890954
-v -0.052676 0.790397 0.890954
-v 0.009824 0.782584 0.898767
-v 0.009824 0.845084 0.203454
-v 0.009824 0.837272 0.148767
-v 0.111386 0.837272 0.156579
-v -0.091739 0.837272 0.156579
-v 0.134824 0.845084 0.234704
-v -0.115176 0.845084 0.234704
-v 0.095761 0.837272 0.297204
-v -0.076114 0.837272 0.297204
-v 0.408261 0.766959 0.055017
-v -0.388614 0.766959 0.055017
-v 0.627011 0.720084 -0.046546
-v -0.607364 0.720084 -0.046546
-v 0.736386 0.696647 -0.194983
-v -0.716739 0.696647 -0.194983
-v 0.752011 0.751334 -0.366858
-v -0.732364 0.751334 -0.366858
-v 0.697324 0.821647 -0.405921
-v -0.677676 0.821647 -0.405921
-v 0.447324 0.891959 -0.538733
-v -0.427676 0.891959 -0.538733
-v 0.322324 0.931022 -0.632483
-v -0.302676 0.931022 -0.632483
-v 0.212949 0.946647 -0.609046
-v -0.193301 0.946647 -0.609046
-v 0.111386 0.938834 -0.421546
-v -0.091739 0.938834 -0.421546
-v 0.134824 0.907584 0.109704
-v -0.115176 0.907584 0.109704
-v 0.220761 0.806022 0.453454
-v -0.201114 0.806022 0.453454
-v 0.259824 0.782584 0.711267
-v -0.240176 0.782584 0.711267
-v 0.275449 0.759147 0.828454
-v -0.255801 0.759147 0.828454
-v 0.244199 0.727897 0.922204
-v -0.224551 0.727897 0.922204
-v 0.173886 0.727897 0.937829
-v -0.154239 0.727897 0.937829
-v 0.009824 0.735709 0.953454
-v 0.009824 0.821647 -0.038733
-v 0.009824 0.860709 -0.202796
-v 0.337949 0.837272 -0.468421
-v -0.318301 0.837272 -0.468421
-v 0.173886 0.845084 -0.132483
-v -0.154239 0.845084 -0.132483
-v 0.142636 0.852897 -0.202796
-v -0.122989 0.852897 -0.202796
-v 0.127011 0.829459 0.695642
-v -0.107364 0.829459 0.695642
-v 0.087949 0.845084 0.453454
-v -0.068301 0.845084 0.453454
-v 0.009824 0.845084 0.453454
-v 0.009824 0.837272 0.336267
-v 0.103574 0.876334 0.281579
-v -0.083926 0.876334 0.281579
-v 0.142636 0.891959 0.234704
-v -0.122989 0.891959 0.234704
-v 0.119199 0.876334 0.140954
-v -0.099551 0.876334 0.140954
-v 0.048886 0.876334 0.133142
-v -0.029239 0.876334 0.133142
-v 0.009824 0.923209 0.211267
-v 0.056699 0.907584 0.156579
-v -0.037051 0.907584 0.156579
-v 0.103574 0.907584 0.164392
-v -0.083926 0.907584 0.164392
-v 0.119199 0.923209 0.234704
-v -0.099551 0.923209 0.234704
-v 0.087949 0.899772 0.258142
-v -0.068301 0.899772 0.258142
-v 0.009824 0.899772 0.297204
-v 0.267636 0.649772 0.320642
-v -0.247989 0.649772 0.320642
-v 0.173886 0.806022 0.250329
-v -0.154239 0.806022 0.250329
-v 0.189511 0.806022 0.320642
-v -0.169864 0.806022 0.320642
-v 0.244199 0.649772 0.258142
-v -0.224551 0.649772 0.258142
-v 0.009824 0.782584 0.883142
-v 0.056699 0.782584 0.875329
-v -0.037051 0.782584 0.875329
-v 0.103574 0.806022 0.828454
-v -0.083926 0.806022 0.828454
-v 0.103574 0.821647 0.750329
-v -0.083926 0.821647 0.750329
-v 0.009824 0.751334 0.789392
-v 0.103574 0.759147 0.758142
-v -0.083926 0.759147 0.758142
-v 0.103574 0.735709 0.820642
-v -0.083926 0.735709 0.820642
-v 0.056699 0.727897 0.859704
-v -0.037051 0.727897 0.859704
-v 0.009824 0.727897 0.867517
-v 0.181699 0.876334 -0.210608
-v -0.162051 0.876334 -0.210608
-v 0.197324 0.868522 -0.148108
-v -0.177676 0.868522 -0.148108
-v 0.345761 0.852897 -0.421546
-v -0.326114 0.852897 -0.421546
-v 0.283261 0.868522 -0.413733
-v -0.263614 0.868522 -0.413733
-v 0.431699 0.868522 -0.390296
-v -0.412051 0.868522 -0.390296
-v 0.572324 0.790397 -0.343421
-v -0.552676 0.790397 -0.343421
-v 0.595761 0.782584 -0.280921
-v -0.576114 0.782584 -0.280921
-v 0.587949 0.774772 -0.187171
-v -0.568301 0.774772 -0.187171
-v 0.486386 0.813834 -0.093421
-v -0.466739 0.813834 -0.093421
-v 0.384824 0.837272 -0.054358
-v -0.365176 0.837272 -0.054358
-v 0.236386 0.876334 -0.101233
-v -0.216739 0.876334 -0.101233
-v 0.189511 0.876334 -0.288733
-v -0.169864 0.876334 -0.288733
-v 0.220761 0.876334 -0.366858
-v -0.201114 0.876334 -0.366858
-v 0.244199 0.852897 -0.351233
-v -0.224551 0.852897 -0.351233
-v 0.205136 0.852897 -0.288733
-v -0.185489 0.852897 -0.288733
-v 0.252011 0.852897 -0.116858
-v -0.232364 0.852897 -0.116858
-v 0.384824 0.821647 -0.077796
-v -0.365176 0.821647 -0.077796
-v 0.470761 0.798209 -0.109046
-v -0.451114 0.798209 -0.109046
-v 0.556699 0.766959 -0.202796
-v -0.537051 0.766959 -0.202796
-v 0.564511 0.766959 -0.273108
-v -0.544864 0.766959 -0.273108
-v 0.541074 0.774772 -0.327796
-v -0.521426 0.774772 -0.327796
-v 0.423886 0.845084 -0.382483
-v -0.404239 0.845084 -0.382483
-v 0.291074 0.860709 -0.390296
-v -0.271426 0.860709 -0.390296
-v 0.345761 0.845084 -0.398108
-v -0.326114 0.845084 -0.398108
-v 0.212949 0.845084 -0.163733
-v -0.193301 0.845084 -0.163733
-v 0.205136 0.845084 -0.218421
-v -0.185489 0.845084 -0.218421
-v 0.119199 0.704459 -0.452796
-v -0.099551 0.704459 -0.452796
-v 0.205136 0.712272 -0.655921
-v -0.185489 0.712272 -0.655921
-v 0.345761 0.688834 -0.679358
-v -0.326114 0.688834 -0.679358
-v 0.494199 0.649772 -0.546546
-v -0.474551 0.649772 -0.546546
-v 0.689511 0.587272 -0.444983
-v -0.669864 0.587272 -0.444983
-v 0.806699 0.556022 -0.398108
-v -0.787051 0.556022 -0.398108
-v 0.783261 0.470084 -0.155921
-v -0.763614 0.470084 -0.155921
-v 0.611386 0.509147 0.008142
-v -0.591739 0.509147 0.008142
-v 0.447324 0.563834 0.101892
-v -0.427676 0.563834 0.101892
-v 0.009824 0.384147 -0.890296
-v 0.009824 0.016959 -0.976233
-v 0.009824 -0.576791 0.203454
-v 0.009824 0.282584 0.469079
-v 0.009824 0.556022 0.984704
-v 0.009824 0.438834 0.812829
-v 0.009824 0.415397 0.578454
-v 0.009824 0.376334 0.492517
-v 0.861386 0.149772 -0.226233
-v -0.841739 0.149772 -0.226233
-v 0.869199 0.048209 -0.312171
-v -0.849551 0.048209 -0.312171
-v 0.783261 -0.342416 -0.257483
-v -0.763614 -0.342416 -0.257483
-v 0.470761 -0.608041 -0.429358
-v -0.451114 -0.608041 -0.429358
-v 0.744199 0.165397 0.055017
-v -0.724551 0.165397 0.055017
-v 0.603574 -0.068978 0.133142
-v -0.583926 -0.068978 0.133142
-v 0.650449 -0.334603 0.015954
-v -0.630801 -0.334603 0.015954
-v 0.345761 -0.568978 -0.046546
-v -0.326114 -0.568978 -0.046546
-v 0.244199 0.501334 0.359704
-v -0.224551 0.501334 0.359704
-v 0.189511 0.352897 0.422204
-v -0.169864 0.352897 0.422204
-v 0.298886 0.477897 0.719079
-v -0.279239 0.477897 0.719079
-v 0.259824 0.485709 0.508142
-v -0.240176 0.485709 0.508142
-v 0.337949 0.493522 0.922204
-v -0.318301 0.493522 0.922204
-v 0.150449 0.462272 0.765954
-v -0.130801 0.462272 0.765954
-v 0.134824 0.454459 0.547204
-v -0.115176 0.454459 0.547204
-v 0.173886 0.532584 0.953454
-v -0.154239 0.532584 0.953454
-v 0.228574 0.524772 0.289392
-v -0.208926 0.524772 0.289392
-v 0.220761 0.563834 0.234704
-v -0.201114 0.563834 0.234704
-v 0.212949 0.595084 0.180017
-v -0.193301 0.595084 0.180017
-v 0.220761 0.259147 0.398767
-v -0.201114 0.259147 0.398767
-v 0.306699 -0.170541 0.320642
-v -0.287051 -0.170541 0.320642
-v 0.353574 -0.443978 0.156579
-v -0.333926 -0.443978 0.156579
-v 0.462949 -0.287728 -0.859046
-v -0.443301 -0.287728 -0.859046
-v 0.462949 0.024772 -0.921546
-v -0.443301 0.024772 -0.921546
-v 0.462949 0.329459 -0.843421
-v -0.443301 0.329459 -0.843421
-v 0.470761 0.524772 -0.515296
-v -0.451114 0.524772 -0.515296
-v 0.736386 0.431022 -0.398108
-v -0.716739 0.431022 -0.398108
-v 0.642636 0.376334 -0.444983
-v -0.622989 0.376334 -0.444983
-v 0.650449 0.149772 -0.694983
-v -0.630801 0.149772 -0.694983
-v 0.806699 0.220084 -0.554358
-v -0.787051 0.220084 -0.554358
-v 0.806699 -0.022103 -0.609046
-v -0.787051 -0.022103 -0.609046
-v 0.650449 -0.100228 -0.741858
-v -0.630801 -0.100228 -0.741858
-v 0.650449 -0.350228 -0.671546
-v -0.630801 -0.350228 -0.671546
-v 0.806699 -0.264291 -0.530921
-v -0.787051 -0.264291 -0.530921
-v 0.627011 -0.490853 -0.319983
-v -0.607364 -0.490853 -0.319983
-v 0.494199 -0.451791 -0.015296
-v -0.474551 -0.451791 -0.015296
-v 0.830136 -0.108041 -0.319983
-v -0.810489 -0.108041 -0.319983
-v 0.416074 0.243522 0.180017
-v -0.396426 0.243522 0.180017
-v 0.439511 -0.115853 0.203454
-v -0.419864 -0.115853 0.203454
-v 0.900449 -0.139291 -0.398108
-v -0.880801 -0.139291 -0.398108
-v 0.783261 -0.029916 0.148767
-v -0.763614 -0.029916 0.148767
-v 1.048886 -0.233041 0.109704
-v -1.029239 -0.233041 0.109704
-v 1.291074 -0.334603 -0.046546
-v -1.271426 -0.334603 -0.046546
-v 1.361386 -0.326791 -0.312171
-v -1.341739 -0.326791 -0.312171
-v 1.244199 -0.326791 -0.499671
-v -1.224551 -0.326791 -0.499671
-v 1.033261 -0.217416 -0.468421
-v -1.013614 -0.217416 -0.468421
-v 1.025449 -0.193978 -0.405921
-v -1.005801 -0.193978 -0.405921
-v 1.197324 -0.295541 -0.429358
-v -1.177676 -0.295541 -0.429358
-v 1.275449 -0.311166 -0.280921
-v -1.255801 -0.311166 -0.280921
-v 1.220761 -0.311166 -0.069983
-v -1.201114 -0.311166 -0.069983
-v 1.041074 -0.209603 0.047204
-v -1.021426 -0.209603 0.047204
-v 0.837949 -0.037728 0.078454
-v -0.818301 -0.037728 0.078454
-v 0.931699 -0.123666 -0.351233
-v -0.912051 -0.123666 -0.351233
-v 0.955136 -0.193978 -0.296546
-v -0.935489 -0.193978 -0.296546
-v 0.892636 -0.115853 0.031579
-v -0.872989 -0.115853 0.031579
-v 1.048886 -0.272103 0.008142
-v -1.029239 -0.272103 0.008142
-v 1.197324 -0.350228 -0.085608
-v -1.177676 -0.350228 -0.085608
-v 1.244199 -0.350228 -0.241858
-v -1.224551 -0.350228 -0.241858
-v 1.181699 -0.342416 -0.351233
-v -1.162051 -0.342416 -0.351233
-v 1.033261 -0.264291 -0.335608
-v -1.013614 -0.264291 -0.335608
-v 0.853574 -0.115853 -0.280921
-v -0.833926 -0.115853 -0.280921
-v 0.845761 -0.178353 -0.163733
-v -0.826114 -0.178353 -0.163733
-v 0.767636 -0.178353 -0.085608
-v -0.747989 -0.178353 -0.085608
-v 0.830136 -0.178353 -0.077796
-v -0.810489 -0.178353 -0.077796
-v 0.853574 -0.178353 -0.007483
-v -0.833926 -0.178353 -0.007483
-v 0.822324 -0.178353 0.023767
-v -0.802676 -0.178353 0.023767
-v 0.736386 0.024772 0.008142
-v -0.716739 0.024772 0.008142
-v 0.728574 -0.076791 0.031579
-v -0.708926 -0.076791 0.031579
-v 0.728574 -0.092416 -0.030921
-v -0.708926 -0.092416 -0.030921
-v 0.806699 -0.115853 -0.194983
-v -0.787051 -0.115853 -0.194983
-v 0.900449 -0.170541 -0.234046
-v -0.880801 -0.170541 -0.234046
-v 0.900449 -0.225228 -0.226233
-v -0.880801 -0.225228 -0.226233
-v 0.822324 -0.225228 0.023767
-v -0.802676 -0.225228 0.023767
-v 0.861386 -0.225228 -0.007483
-v -0.841739 -0.225228 -0.007483
-v 0.837949 -0.225228 -0.069983
-v -0.818301 -0.225228 -0.069983
-v 0.775449 -0.225228 -0.085608
-v -0.755801 -0.225228 -0.085608
-v 0.853574 -0.225228 -0.163733
-v -0.833926 -0.225228 -0.163733
-v 1.048886 -0.318978 -0.319983
-v -1.029239 -0.318978 -0.319983
-v 1.197324 -0.389291 -0.335608
-v -1.177676 -0.389291 -0.335608
-v 1.267636 -0.397103 -0.234046
-v -1.247989 -0.397103 -0.234046
-v 1.220761 -0.389291 -0.077796
-v -1.201114 -0.389291 -0.077796
-v 1.056699 -0.326791 0.008142
-v -1.037051 -0.326791 0.008142
-v 0.892636 -0.170541 0.023767
-v -0.872989 -0.170541 0.023767
-v 0.962949 -0.248666 -0.280921
-v -0.943301 -0.248666 -0.280921
-v 0.900449 -0.233041 -0.101233
-v -0.880801 -0.233041 -0.101233
-v 0.947324 -0.240853 -0.054358
-v -0.927676 -0.240853 -0.054358
-v 1.009824 -0.272103 -0.116858
-v -0.990176 -0.272103 -0.116858
-v 0.970761 -0.256478 -0.163733
-v -0.951114 -0.256478 -0.163733
-v 1.025449 -0.279916 -0.226233
-v -1.005801 -0.279916 -0.226233
-v 1.064511 -0.287728 -0.179358
-v -1.044864 -0.287728 -0.179358
-v 1.119199 -0.295541 -0.202796
-v -1.099551 -0.295541 -0.202796
-v 1.095761 -0.295541 -0.265296
-v -1.076114 -0.295541 -0.265296
-v 1.033261 -0.389291 -0.429358
-v -1.013614 -0.389291 -0.429358
-v 1.259824 -0.451791 -0.460608
-v -1.240176 -0.451791 -0.460608
-v 1.377011 -0.404916 -0.288733
-v -1.357364 -0.404916 -0.288733
-v 1.322324 -0.436166 -0.046546
-v -1.302676 -0.436166 -0.046546
-v 1.048886 -0.397103 0.094079
-v -1.029239 -0.397103 0.094079
-v 0.798886 -0.233041 0.133142
-v -0.779239 -0.233041 0.133142
-v 0.869199 -0.287728 -0.374671
-v -0.849551 -0.287728 -0.374671
-usemtl (null)
-s off
-f 47 1 3 45
-f 4 2 48 46
-f 45 3 5 43
-f 6 4 46 44
-f 3 9 7 5
-f 8 10 4 6
-f 1 11 9 3
-f 10 12 2 4
-f 11 13 15 9
-f 16 14 12 10
-f 9 15 17 7
-f 18 16 10 8
-f 15 21 19 17
-f 20 22 16 18
-f 13 23 21 15
-f 22 24 14 16
-f 23 25 27 21
-f 28 26 24 22
-f 21 27 29 19
-f 30 28 22 20
-f 27 33 31 29
-f 32 34 28 30
-f 25 35 33 27
-f 34 36 26 28
-f 35 37 39 33
-f 40 38 36 34
-f 33 39 41 31
-f 42 40 34 32
-f 39 45 43 41
-f 44 46 40 42
-f 37 47 45 39
-f 46 48 38 40
-f 47 37 51 49
-f 52 38 48 50
-f 37 35 53 51
-f 54 36 38 52
-f 35 25 55 53
-f 56 26 36 54
-f 25 23 57 55
-f 58 24 26 56
-f 23 13 59 57
-f 60 14 24 58
-f 13 11 63 59
-f 64 12 14 60
-f 11 1 65 63
-f 66 2 12 64
-f 1 47 49 65
-f 50 48 2 66
-f 61 65 49
-f 50 66 62
-f 63 65 61
-f 62 66 64
-f 61 59 63
-f 64 60 62
-f 61 57 59
-f 60 58 62
-f 61 55 57
-f 58 56 62
-f 61 53 55
-f 56 54 62
-f 61 51 53
-f 54 52 62
-f 61 49 51
-f 52 50 62
-f 89 174 176 91
-f 176 175 90 91
-f 87 172 174 89
-f 175 173 88 90
-f 85 170 172 87
-f 173 171 86 88
-f 83 168 170 85
-f 171 169 84 86
-f 81 166 168 83
-f 169 167 82 84
-f 79 92 146 164
-f 147 93 80 165
-f 92 94 148 146
-f 149 95 93 147
-f 94 96 150 148
-f 151 97 95 149
-f 96 98 152 150
-f 153 99 97 151
-f 98 100 154 152
-f 155 101 99 153
-f 100 102 156 154
-f 157 103 101 155
-f 102 104 158 156
-f 159 105 103 157
-f 104 106 160 158
-f 161 107 105 159
-f 106 108 162 160
-f 163 109 107 161
-f 108 67 68 162
-f 68 67 109 163
-f 110 128 160 162
-f 161 129 111 163
-f 128 179 158 160
-f 159 180 129 161
-f 126 156 158 179
-f 159 157 127 180
-f 124 154 156 126
-f 157 155 125 127
-f 122 152 154 124
-f 155 153 123 125
-f 120 150 152 122
-f 153 151 121 123
-f 118 148 150 120
-f 151 149 119 121
-f 116 146 148 118
-f 149 147 117 119
-f 114 164 146 116
-f 147 165 115 117
-f 114 181 177 164
-f 177 182 115 165
-f 110 162 68 112
-f 68 163 111 113
-f 112 68 178 183
-f 178 68 113 184
-f 177 181 183 178
-f 184 182 177 178
-f 135 137 176 174
-f 176 137 136 175
-f 133 135 174 172
-f 175 136 134 173
-f 131 133 172 170
-f 173 134 132 171
-f 166 187 185 168
-f 186 188 167 169
-f 131 170 168 185
-f 169 171 132 186
-f 144 190 189 187
-f 189 190 145 188
-f 185 187 189 69
-f 189 188 186 69
-f 130 131 185 69
-f 186 132 130 69
-f 142 193 191 144
-f 192 194 143 145
-f 140 195 193 142
-f 194 196 141 143
-f 139 197 195 140
-f 196 198 139 141
-f 138 71 197 139
-f 198 71 138 139
-f 190 144 191 70
-f 192 145 190 70
-f 70 191 206 208
-f 207 192 70 208
-f 71 199 200 197
-f 201 199 71 198
-f 197 200 202 195
-f 203 201 198 196
-f 195 202 204 193
-f 205 203 196 194
-f 193 204 206 191
-f 207 205 194 192
-f 199 204 202 200
-f 203 205 199 201
-f 199 208 206 204
-f 207 208 199 205
-f 139 140 164 177
-f 165 141 139 177
-f 140 142 211 164
-f 212 143 141 165
-f 142 144 213 211
-f 214 145 143 212
-f 144 187 166 213
-f 167 188 145 214
-f 81 209 213 166
-f 214 210 82 167
-f 209 215 211 213
-f 212 216 210 214
-f 79 164 211 215
-f 212 165 80 216
-f 131 130 72 222
-f 72 130 132 223
-f 133 131 222 220
-f 223 132 134 221
-f 135 133 220 218
-f 221 134 136 219
-f 137 135 218 217
-f 219 136 137 217
-f 217 218 229 231
-f 230 219 217 231
-f 218 220 227 229
-f 228 221 219 230
-f 220 222 225 227
-f 226 223 221 228
-f 222 72 224 225
-f 224 72 223 226
-f 224 231 229 225
-f 230 231 224 226
-f 225 229 227
-f 228 230 226
-f 183 181 234 232
-f 235 182 184 233
-f 112 183 232 254
-f 233 184 113 255
-f 110 112 254 256
-f 255 113 111 257
-f 181 114 252 234
-f 253 115 182 235
-f 114 116 250 252
-f 251 117 115 253
-f 116 118 248 250
-f 249 119 117 251
-f 118 120 246 248
-f 247 121 119 249
-f 120 122 244 246
-f 245 123 121 247
-f 122 124 242 244
-f 243 125 123 245
-f 124 126 240 242
-f 241 127 125 243
-f 126 179 236 240
-f 237 180 127 241
-f 179 128 238 236
-f 239 129 180 237
-f 128 110 256 238
-f 257 111 129 239
-f 238 256 258 276
-f 259 257 239 277
-f 236 238 276 278
-f 277 239 237 279
-f 240 236 278 274
-f 279 237 241 275
-f 242 240 274 272
-f 275 241 243 273
-f 244 242 272 270
-f 273 243 245 271
-f 246 244 270 268
-f 271 245 247 269
-f 248 246 268 266
-f 269 247 249 267
-f 250 248 266 264
-f 267 249 251 265
-f 252 250 264 262
-f 265 251 253 263
-f 234 252 262 280
-f 263 253 235 281
-f 256 254 260 258
-f 261 255 257 259
-f 254 232 282 260
-f 283 233 255 261
-f 232 234 280 282
-f 281 235 233 283
-f 67 108 284 73
-f 285 109 67 73
-f 108 106 286 284
-f 287 107 109 285
-f 106 104 288 286
-f 289 105 107 287
-f 104 102 290 288
-f 291 103 105 289
-f 102 100 292 290
-f 293 101 103 291
-f 100 98 294 292
-f 295 99 101 293
-f 98 96 296 294
-f 297 97 99 295
-f 96 94 298 296
-f 299 95 97 297
-f 94 92 300 298
-f 301 93 95 299
-f 308 309 328 338
-f 329 309 308 339
-f 307 308 338 336
-f 339 308 307 337
-f 306 307 336 340
-f 337 307 306 341
-f 89 91 306 340
-f 306 91 90 341
-f 87 89 340 334
-f 341 90 88 335
-f 85 87 334 330
-f 335 88 86 331
-f 83 85 330 332
-f 331 86 84 333
-f 330 336 338 332
-f 339 337 331 333
-f 330 334 340 336
-f 341 335 331 337
-f 326 332 338 328
-f 339 333 327 329
-f 81 83 332 326
-f 333 84 82 327
-f 209 342 344 215
-f 345 343 210 216
-f 81 326 342 209
-f 343 327 82 210
-f 79 215 344 346
-f 345 216 80 347
-f 79 346 300 92
-f 301 347 80 93
-f 77 324 352 304
-f 353 325 77 304
-f 304 352 350 78
-f 351 353 304 78
-f 78 350 348 305
-f 349 351 78 305
-f 305 348 328 309
-f 329 349 305 309
-f 326 328 348 342
-f 349 329 327 343
-f 296 298 318 310
-f 319 299 297 311
-f 76 316 324 77
-f 325 317 76 77
-f 302 358 356 303
-f 357 359 302 303
-f 303 356 354 75
-f 355 357 303 75
-f 75 354 316 76
-f 317 355 75 76
-f 292 294 362 364
-f 363 295 293 365
-f 364 362 368 366
-f 369 363 365 367
-f 366 368 370 372
-f 371 369 367 373
-f 372 370 376 374
-f 377 371 373 375
-f 314 378 374 376
-f 375 379 315 377
-f 316 354 374 378
-f 375 355 317 379
-f 354 356 372 374
-f 373 357 355 375
-f 356 358 366 372
-f 367 359 357 373
-f 358 360 364 366
-f 365 361 359 367
-f 290 292 364 360
-f 365 293 291 361
-f 74 360 358 302
-f 359 361 74 302
-f 284 286 288 290
-f 289 287 285 291
-f 284 290 360 74
-f 361 291 285 74
-f 73 284 74
-f 74 285 73
-f 294 296 310 362
-f 311 297 295 363
-f 310 312 368 362
-f 369 313 311 363
-f 312 382 370 368
-f 371 383 313 369
-f 314 376 370 382
-f 371 377 315 383
-f 348 350 386 384
-f 387 351 349 385
-f 318 384 386 320
-f 387 385 319 321
-f 298 300 384 318
-f 385 301 299 319
-f 300 344 342 384
-f 343 345 301 385
-f 342 348 384
-f 385 349 343
-f 300 346 344
-f 345 347 301
-f 314 322 380 378
-f 381 323 315 379
-f 316 378 380 324
-f 381 379 317 325
-f 320 386 380 322
-f 381 387 321 323
-f 350 352 380 386
-f 381 353 351 387
-f 324 380 352
-f 353 381 325
-f 400 388 414 402
-f 415 389 401 403
-f 400 402 404 398
-f 405 403 401 399
-f 398 404 406 396
-f 407 405 399 397
-f 396 406 408 394
-f 409 407 397 395
-f 394 408 410 392
-f 411 409 395 393
-f 392 410 412 390
-f 413 411 393 391
-f 410 420 418 412
-f 419 421 411 413
-f 408 422 420 410
-f 421 423 409 411
-f 406 424 422 408
-f 423 425 407 409
-f 404 426 424 406
-f 425 427 405 407
-f 402 428 426 404
-f 427 429 403 405
-f 402 414 416 428
-f 417 415 403 429
-f 318 320 444 442
-f 445 321 319 443
-f 320 390 412 444
-f 413 391 321 445
-f 310 318 442 312
-f 443 319 311 313
-f 382 430 414 388
-f 415 431 383 389
-f 412 418 440 444
-f 441 419 413 445
-f 438 446 444 440
-f 445 447 439 441
-f 434 446 438 436
-f 439 447 435 437
-f 432 448 446 434
-f 447 449 433 435
-f 430 448 432 450
-f 433 449 431 451
-f 414 430 450 416
-f 451 431 415 417
-f 312 448 430 382
-f 431 449 313 383
-f 312 442 446 448
-f 447 443 313 449
-f 442 444 446
-f 447 445 443
-f 416 450 452 476
-f 453 451 417 477
-f 450 432 462 452
-f 463 433 451 453
-f 432 434 460 462
-f 461 435 433 463
-f 434 436 458 460
-f 459 437 435 461
-f 436 438 456 458
-f 457 439 437 459
-f 438 440 454 456
-f 455 441 439 457
-f 440 418 474 454
-f 475 419 441 455
-f 428 416 476 464
-f 477 417 429 465
-f 426 428 464 466
-f 465 429 427 467
-f 424 426 466 468
-f 467 427 425 469
-f 422 424 468 470
-f 469 425 423 471
-f 420 422 470 472
-f 471 423 421 473
-f 418 420 472 474
-f 473 421 419 475
-f 458 456 480 478
-f 481 457 459 479
-f 478 480 482 484
-f 483 481 479 485
-f 484 482 488 486
-f 489 483 485 487
-f 486 488 490 492
-f 491 489 487 493
-f 464 476 486 492
-f 487 477 465 493
-f 452 484 486 476
-f 487 485 453 477
-f 452 462 478 484
-f 479 463 453 485
-f 458 478 462 460
-f 463 479 459 461
-f 454 474 480 456
-f 481 475 455 457
-f 472 482 480 474
-f 481 483 473 475
-f 470 488 482 472
-f 483 489 471 473
-f 468 490 488 470
-f 489 491 469 471
-f 466 492 490 468
-f 491 493 467 469
-f 464 492 466
-f 467 493 465
-f 392 390 504 502
-f 505 391 393 503
-f 394 392 502 500
-f 503 393 395 501
-f 396 394 500 498
-f 501 395 397 499
-f 398 396 498 496
-f 499 397 399 497
-f 400 398 496 494
-f 497 399 401 495
-f 388 400 494 506
-f 495 401 389 507
-f 494 502 504 506
-f 505 503 495 507
-f 494 496 500 502
-f 501 497 495 503
-f 496 498 500
-f 501 499 497
-f 314 382 388 506
-f 389 383 315 507
-f 314 506 504 322
-f 505 507 315 323
-f 320 322 504 390
-f 505 323 321 391
diff --git a/tests/manual/displaymodel/qml/meshes/teapot.bez b/tests/manual/displaymodel/qml/meshes/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/tests/manual/displaymodel/qml/meshes/teapot.bez
+++ /dev/null
@@ -1,340 +0,0 @@
-32
-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
-4,17,18,19,8,20,21,22,12,23,24,25,16,26,27,28
-19,29,30,31,22,32,33,34,25,35,36,37,28,38,39,40
-31,41,42,1,34,43,44,5,37,45,46,9,40,47,48,13
-13,14,15,16,49,50,51,52,53,54,55,56,57,58,59,60
-16,26,27,28,52,61,62,63,56,64,65,66,60,67,68,69
-28,38,39,40,63,70,71,72,66,73,74,75,69,76,77,78
-40,47,48,13,72,79,80,49,75,81,82,53,78,83,84,57
-57,58,59,60,85,86,87,88,89,90,91,92,93,94,95,96
-60,67,68,69,88,97,98,99,92,100,101,102,96,103,104,105
-69,76,77,78,99,106,107,108,102,109,110,111,105,112,113,114
-78,83,84,57,108,115,116,85,111,117,118,89,114,119,120,93
-121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136
-124,137,138,121,128,139,140,125,132,141,142,129,136,143,144,133
-133,134,135,136,145,146,147,148,149,150,151,152,69,153,154,155
-136,143,144,133,148,156,157,145,152,158,159,149,155,160,161,69
-162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177
-165,178,179,162,169,180,181,166,173,182,183,170,177,184,185,174
-174,175,176,177,186,187,188,189,190,191,192,193,194,195,196,197
-177,184,185,174,189,198,199,186,193,200,201,190,197,202,203,194
-204,204,204,204,207,208,209,210,211,211,211,211,212,213,214,215,4
-204,204,204,204,210,217,218,219,211,211,211,211,215,220,221,222,4
-204,204,204,204,219,224,225,226,211,211,211,211,222,227,228,229,4
-204,204,204,204,226,230,231,207,211,211,211,211,229,232,233,212,4
-212,213,214,215,234,235,236,237,238,239,240,241,242,243,244,245
-215,220,221,222,237,246,247,248,241,249,250,251,245,252,253,254
-222,227,228,229,248,255,256,257,251,258,259,260,254,261,262,263
-229,232,233,212,257,264,265,234,260,266,267,238,263,268,269,242
-270,270,270,270,279,280,281,282,275,276,277,278,271,272,273,274,4
-270,270,270,270,282,289,290,291,278,286,287,288,274,283,284,285,4
-270,270,270,270,291,298,299,300,288,295,296,297,285,292,293,294,4
-270,270,270,270,300,305,306,279,297,303,304,275,294,301,302,271,4
-306
-0.700000,0.450000,-0.000000
-0.700000,0.450000,0.392000
-0.392000,0.450000,0.700000
-0.000000,0.450000,0.700000
-0.668750,0.515625,-0.000000
-0.668750,0.515625,0.374500
-0.374500,0.515625,0.668750
-0.000000,0.515625,0.668750
-0.718750,0.515625,-0.000000
-0.718750,0.515625,0.402500
-0.402500,0.515625,0.718750
-0.000000,0.515625,0.718750
-0.750000,0.450000,-0.000000
-0.750000,0.450000,0.420000
-0.420000,0.450000,0.750000
-0.000000,0.450000,0.750000
--0.392000,0.450000,0.700000
--0.700000,0.450000,0.392000
--0.700000,0.450000,-0.000000
--0.374500,0.515625,0.668750
--0.668750,0.515625,0.374500
--0.668750,0.515625,-0.000000
--0.402500,0.515625,0.718750
--0.718750,0.515625,0.402500
--0.718750,0.515625,-0.000000
--0.420000,0.450000,0.750000
--0.750000,0.450000,0.420000
--0.750000,0.450000,-0.000000
--0.700000,0.450000,-0.392000
--0.392000,0.450000,-0.700000
-0.000000,0.450000,-0.700000
--0.668750,0.515625,-0.374500
--0.374500,0.515625,-0.668750
-0.000000,0.515625,-0.668750
--0.718750,0.515625,-0.402500
--0.402500,0.515625,-0.718750
-0.000000,0.515625,-0.718750
--0.750000,0.450000,-0.420000
--0.420000,0.450000,-0.750000
-0.000000,0.450000,-0.750000
-0.392000,0.450000,-0.700000
-0.700000,0.450000,-0.392000
-0.374500,0.515625,-0.668750
-0.668750,0.515625,-0.374500
-0.402500,0.515625,-0.718750
-0.718750,0.515625,-0.402500
-0.420000,0.450000,-0.750000
-0.750000,0.450000,-0.420000
-0.875000,0.187500,-0.000000
-0.875000,0.187500,0.490000
-0.490000,0.187500,0.875000
-0.000000,0.187500,0.875000
-1.000000,-0.075000,-0.000000
-1.000000,-0.075000,0.560000
-0.560000,-0.075000,1.000000
-0.000000,-0.075000,1.000000
-1.000000,-0.300000,-0.000000
-1.000000,-0.300000,0.560000
-0.560000,-0.300000,1.000000
-0.000000,-0.300000,1.000000
--0.490000,0.187500,0.875000
--0.875000,0.187500,0.490000
--0.875000,0.187500,-0.000000
--0.560000,-0.075000,1.000000
--1.000000,-0.075000,0.560000
--1.000000,-0.075000,-0.000000
--0.560000,-0.300000,1.000000
--1.000000,-0.300000,0.560000
--1.000000,-0.300000,-0.000000
--0.875000,0.187500,-0.490000
--0.490000,0.187500,-0.875000
-0.000000,0.187500,-0.875000
--1.000000,-0.075000,-0.560000
--0.560000,-0.075000,-1.000000
-0.000000,-0.075000,-1.000000
--1.000000,-0.300000,-0.560000
--0.560000,-0.300000,-1.000000
-0.000000,-0.300000,-1.000000
-0.490000,0.187500,-0.875000
-0.875000,0.187500,-0.490000
-0.560000,-0.075000,-1.000000
-1.000000,-0.075000,-0.560000
-0.560000,-0.300000,-1.000000
-1.000000,-0.300000,-0.560000
-1.000000,-0.525000,-0.000000
-1.000000,-0.525000,0.560000
-0.560000,-0.525000,1.000000
-0.000000,-0.525000,1.000000
-0.750000,-0.637500,-0.000000
-0.750000,-0.637500,0.420000
-0.420000,-0.637500,0.750000
-0.000000,-0.637500,0.750000
-0.750000,-0.675000,-0.000000
-0.750000,-0.675000,0.420000
-0.420000,-0.675000,0.750000
-0.000000,-0.675000,0.750000
--0.560000,-0.525000,1.000000
--1.000000,-0.525000,0.560000
--1.000000,-0.525000,-0.000000
--0.420000,-0.637500,0.750000
--0.750000,-0.637500,0.420000
--0.750000,-0.637500,-0.000000
--0.420000,-0.675000,0.750000
--0.750000,-0.675000,0.420000
--0.750000,-0.675000,-0.000000
--1.000000,-0.525000,-0.560000
--0.560000,-0.525000,-1.000000
-0.000000,-0.525000,-1.000000
--0.750000,-0.637500,-0.420000
--0.420000,-0.637500,-0.750000
-0.000000,-0.637500,-0.750000
--0.750000,-0.675000,-0.420000
--0.420000,-0.675000,-0.750000
-0.000000,-0.675000,-0.750000
-0.560000,-0.525000,-1.000000
-1.000000,-0.525000,-0.560000
-0.420000,-0.637500,-0.750000
-0.750000,-0.637500,-0.420000
-0.420000,-0.675000,-0.750000
-0.750000,-0.675000,-0.420000
--0.800000,0.262500,-0.000000
--0.800000,0.262500,0.150000
--0.750000,0.375000,0.150000
--0.750000,0.375000,-0.000000
--1.150000,0.262500,-0.000000
--1.150000,0.262500,0.150000
--1.250000,0.375000,0.150000
--1.250000,0.375000,-0.000000
--1.350000,0.262500,-0.000000
--1.350000,0.262500,0.150000
--1.500000,0.375000,0.150000
--1.500000,0.375000,-0.000000
--1.350000,0.150000,-0.000000
--1.350000,0.150000,0.150000
--1.500000,0.150000,0.150000
--1.500000,0.150000,-0.000000
--0.750000,0.375000,-0.150000
--0.800000,0.262500,-0.150000
--1.250000,0.375000,-0.150000
--1.150000,0.262500,-0.150000
--1.500000,0.375000,-0.150000
--1.350000,0.262500,-0.150000
--1.500000,0.150000,-0.150000
--1.350000,0.150000,-0.150000
--1.350000,0.037500,-0.000000
--1.350000,0.037500,0.150000
--1.500000,-0.075000,0.150000
--1.500000,-0.075000,-0.000000
--1.250000,-0.187500,-0.000000
--1.250000,-0.187500,0.150000
--1.325000,-0.281250,0.150000
--1.325000,-0.281250,-0.000000
--1.000000,-0.300000,0.150000
--0.950000,-0.450000,0.150000
--0.950000,-0.450000,-0.000000
--1.500000,-0.075000,-0.150000
--1.350000,0.037500,-0.150000
--1.325000,-0.281250,-0.150000
--1.250000,-0.187500,-0.150000
--0.950000,-0.450000,-0.150000
--1.000000,-0.300000,-0.150000
-0.850000,-0.037500,-0.000000
-0.850000,-0.037500,0.330000
-0.850000,-0.450000,0.330000
-0.850000,-0.450000,-0.000000
-1.300000,-0.037500,-0.000000
-1.300000,-0.037500,0.330000
-1.550000,-0.337500,0.330000
-1.550000,-0.337500,-0.000000
-1.150000,0.300000,-0.000000
-1.150000,0.300000,0.125000
-1.200000,0.262500,0.125000
-1.200000,0.262500,-0.000000
-1.350000,0.450000,-0.000000
-1.350000,0.450000,0.125000
-1.650000,0.450000,0.125000
-1.650000,0.450000,-0.000000
-0.850000,-0.450000,-0.330000
-0.850000,-0.037500,-0.330000
-1.550000,-0.337500,-0.330000
-1.300000,-0.037500,-0.330000
-1.200000,0.262500,-0.125000
-1.150000,0.300000,-0.125000
-1.650000,0.450000,-0.125000
-1.350000,0.450000,-0.125000
-1.400000,0.487500,-0.000000
-1.400000,0.487500,0.125000
-1.762500,0.496875,0.125000
-1.762500,0.496875,-0.000000
-1.450000,0.487500,-0.000000
-1.450000,0.487500,0.075000
-1.725000,0.506250,0.075000
-1.725000,0.506250,-0.000000
-1.400000,0.450000,-0.000000
-1.400000,0.450000,0.075000
-1.600000,0.450000,0.075000
-1.600000,0.450000,-0.000000
-1.762500,0.496875,-0.125000
-1.400000,0.487500,-0.125000
-1.725000,0.506250,-0.075000
-1.450000,0.487500,-0.075000
-1.600000,0.450000,-0.075000
-1.400000,0.450000,-0.075000
-0.000000,0.825000,-0.000000
-0.000000,0.825000,0.001000
-0.001000,0.825000,-0.000000
-0.400000,0.825000,-0.000000
-0.400000,0.825000,0.225000
-0.225000,0.825000,0.400000
-0.000000,0.825000,0.400000
-0.000000,0.675000,-0.000000
-0.100000,0.600000,-0.000000
-0.100000,0.600000,0.056000
-0.056000,0.600000,0.100000
-0.000000,0.600000,0.100000
--0.001000,0.825000,-0.000000
--0.225000,0.825000,0.400000
--0.400000,0.825000,0.225000
--0.400000,0.825000,-0.000000
--0.056000,0.600000,0.100000
--0.100000,0.600000,0.056000
--0.100000,0.600000,-0.000000
-0.000000,0.825000,-0.001000
--0.400000,0.825000,-0.225000
--0.225000,0.825000,-0.400000
-0.000000,0.825000,-0.400000
--0.100000,0.600000,-0.056000
--0.056000,0.600000,-0.100000
-0.000000,0.600000,-0.100000
-0.225000,0.825000,-0.400000
-0.400000,0.825000,-0.225000
-0.056000,0.600000,-0.100000
-0.100000,0.600000,-0.056000
-0.200000,0.525000,-0.000000
-0.200000,0.525000,0.112000
-0.112000,0.525000,0.200000
-0.000000,0.525000,0.200000
-0.650000,0.525000,-0.000000
-0.650000,0.525000,0.364000
-0.364000,0.525000,0.650000
-0.000000,0.525000,0.650000
-0.650000,0.450000,-0.000000
-0.650000,0.450000,0.364000
-0.364000,0.450000,0.650000
-0.000000,0.450000,0.650000
--0.112000,0.525000,0.200000
--0.200000,0.525000,0.112000
--0.200000,0.525000,-0.000000
--0.364000,0.525000,0.650000
--0.650000,0.525000,0.364000
--0.650000,0.525000,-0.000000
--0.364000,0.450000,0.650000
--0.650000,0.450000,0.364000
--0.650000,0.450000,-0.000000
--0.200000,0.525000,-0.112000
--0.112000,0.525000,-0.200000
-0.000000,0.525000,-0.200000
--0.650000,0.525000,-0.364000
--0.364000,0.525000,-0.650000
-0.000000,0.525000,-0.650000
--0.650000,0.450000,-0.364000
--0.364000,0.450000,-0.650000
-0.000000,0.450000,-0.650000
-0.112000,0.525000,-0.200000
-0.200000,0.525000,-0.112000
-0.364000,0.525000,-0.650000
-0.650000,0.525000,-0.364000
-0.364000,0.450000,-0.650000
-0.650000,0.450000,-0.364000
-0.000000,-0.750000,-0.000000
-0.750000,-0.675000,-0.000000
-0.750000,-0.675000,-0.420000
-0.420000,-0.675000,-0.750000
-0.000000,-0.675000,-0.750000
-0.750000,-0.712500,-0.000000
-0.750000,-0.712500,-0.420000
-0.420000,-0.712500,-0.750000
-0.000000,-0.712500,-0.750000
-0.712500,-0.750000,-0.000000
-0.712500,-0.750000,-0.399000
-0.399000,-0.750000,-0.712500
-0.000000,-0.750000,-0.712500
--0.420000,-0.675000,-0.750000
--0.750000,-0.675000,-0.420000
--0.750000,-0.675000,-0.000000
--0.420000,-0.712500,-0.750000
--0.750000,-0.712500,-0.420000
--0.750000,-0.712500,-0.000000
--0.399000,-0.750000,-0.712500
--0.712500,-0.750000,-0.399000
--0.712500,-0.750000,-0.000000
--0.750000,-0.675000,0.420000
--0.420000,-0.675000,0.750000
-0.000000,-0.675000,0.750000
--0.750000,-0.712500,0.420000
--0.420000,-0.712500,0.750000
-0.000000,-0.712500,0.750000
--0.712500,-0.750000,0.399000
--0.399000,-0.750000,0.712500
-0.000000,-0.750000,0.712500
-0.420000,-0.675000,0.750000
-0.750000,-0.675000,0.420000
-0.420000,-0.712500,0.750000
-0.750000,-0.712500,0.420000
-0.399000,-0.750000,0.712500
-0.712500,-0.750000,0.399000
diff --git a/tests/manual/displaymodel/qml/tst_displaymodel.qml b/tests/manual/displaymodel/qml/tst_displaymodel.qml
deleted file mode 100644
index 219d6993..00000000
--- a/tests/manual/displaymodel/qml/tst_displaymodel.qml
+++ /dev/null
@@ -1,371 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-17392 / QTBUG-17391
-Item {
- id: screen
- width: 720
- height: 480
-
- //ITEM 1: Points
- Rectangle {
- id: panel1
- x: 0; y:0
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,3,15)}
- picking: true
-
- Point {
- vertices: [
- -1, 1, 0,
- -1, -2, 0,
- 1, -2, 0
- ]
- pointSize: 3
- onClicked: console.log("Points clicked")
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text1.height + 10
- Text {
- id: text1
- width: parent.width
- wrapMode: "WordWrap"
- text: " POINT CONSTRUCTION:\n 3 Points in an L shape should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 2: Lines
- Rectangle {
- id: panel2
- anchors.left: panel1.right
- anchors.top: parent.top
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,3,15)}
- picking: true
-
- Line {
- vertices: [
- -1, 1, 0,
- -1, -2, 0,
- 1, -2, 0
- ]
- width: 3
- onClicked: console.log("Line clicked")
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text2.height + 10
- Text {
- id: text2
- width: parent.width
- wrapMode: "WordWrap"
- text: " LINE CONSTRUCTION:\n 2 Lines in an L shape should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 3: A Sphere
- Rectangle {
- id: panel3
- anchors.left: panel2.right
- anchors.top: parent.top
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Sphere {onClicked: console.log("Sphere clicked")}
- }
- //text for item3
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text3.height + 10
- Text {
- id: text3
- width: parent.width
- wrapMode: "WordWrap"
- text: " SPHERE CONSTRUCTION:\n A shaded sphere should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 4: A Cylinder
- Rectangle {
- id: panel4
- anchors.left: parent.left
- anchors.top: panel1.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Cylinder {height: 3; onClicked: console.log("Cylinder clicked");}
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text4.height + 10
- Text {
- id: text4
- width: parent.width
- wrapMode: "WordWrap"
- text: " CYLINDER CONSTRUCTION:\n A shaded cylinder with 8 sides should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 5: A Capsule
- Rectangle {
- id: panel5
- anchors.left: panel4.right
- anchors.top: panel2.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Capsule {onClicked: console.log("Capsule clicked");}
-
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text5.height + 10
- Text {
- id: text5
- width: parent.width
- wrapMode: "WordWrap"
- text: " CAPSULE CONSTRUCTION:\n A shaded capsule with 8 sides should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 6: A Quad
- Rectangle {
- id: panel6
- anchors.left: panel5.right
- anchors.top: panel3.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera {eye: Qt.vector3d(0,5,10)}
- picking: true
-
- Quad {
- scale: 2;
- onClicked: console.log("Quad clicked")
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text6.height + 10
- Text {
- id: text6
- width: parent.width
- wrapMode: "WordWrap"
- text: " .OBJ LOADING:\n A planar quad should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 7: A Cube
- Rectangle {
- id: panel7
- anchors.left: parent.left
- anchors.top: panel4.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Cube {
- scale: 2
- onClicked: console.log("Cube clicked");
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text7.height + 10
- Text {
- id: text7
- width: parent.width
- wrapMode: "WordWrap"
- text: " .OBJ LOADING:\n A shaded cube should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 8: A Teapot
- Rectangle {
- id: panel8
- anchors.left: panel7.right
- anchors.top: panel5.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Teapot {
- scale: 1.3
- onClicked: console.log("Teapot clicked");
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text8.height + 10
- Text {
- id: text8
- width: parent.width
- wrapMode: "WordWrap"
- text: " .BEZ LOADING:\n A shaded teapot should be visible."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 9: A Lunar Lander
- Rectangle {
- id: panel9
- anchors.left: panel8.right
- anchors.top: panel6.bottom
- width: screen.width/3
- height: screen.height/3
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
- picking: true
-
- Item3D {
- scale: 0.5
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/lunar-lander.3ds"}
- onClicked: console.log("Lunar lander clicked")
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text9.height + 10
- Text {
- id: text9
- width: parent.width
- wrapMode: "WordWrap"
- text: " .3DS LOADING:\n A lunar lander module should be visible."
- anchors.centerIn: parent
- }
- }
- }
-}
-
diff --git a/tests/manual/fullreferencing/README b/tests/manual/fullreferencing/README
deleted file mode 100644
index f7994e81..00000000
--- a/tests/manual/fullreferencing/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This test renders a cube against a cleared black background.
-
-The cube should be able to be manipulated by dragging the mouse
-pointer around the window.
-
-The aim is to have the simplest possible test which shows rendering
-3D content with no 2D content.
-
-When the 3D content is free of 2D QML in this way optimized approaches may
-be used and this test (along with "background") is meant to be the simplest test
-of this behavior.
diff --git a/tests/manual/fullreferencing/fullreferencing.pro b/tests/manual/fullreferencing/fullreferencing.pro
deleted file mode 100644
index fead7f3a..00000000
--- a/tests/manual/fullreferencing/fullreferencing.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = app
-TARGET = tst_fullreferencing
-CONFIG += qt warn_on
-QT += declarative quick
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/fullreferencing/icon-l-qtquick3d.png b/tests/manual/fullreferencing/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/fullreferencing/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/fullreferencing/main.cpp b/tests/manual/fullreferencing/main.cpp
deleted file mode 100644
index 646be1c0..00000000
--- a/tests/manual/fullreferencing/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_fullreferencing.qml")
diff --git a/tests/manual/fullreferencing/qml/meshes/hazard.png b/tests/manual/fullreferencing/qml/meshes/hazard.png
deleted file mode 100644
index a7c0b7fe..00000000
--- a/tests/manual/fullreferencing/qml/meshes/hazard.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/fullreferencing/qml/meshes/robot.3ds b/tests/manual/fullreferencing/qml/meshes/robot.3ds
deleted file mode 100644
index ed872c82..00000000
--- a/tests/manual/fullreferencing/qml/meshes/robot.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/fullreferencing/qml/tst_fullreferencing.qml b/tests/manual/fullreferencing/qml/tst_fullreferencing.qml
deleted file mode 100644
index 1a6819d0..00000000
--- a/tests/manual/fullreferencing/qml/tst_fullreferencing.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: screen
- width: 640
- height: 520
- objectName: "toplevelrect"
- color: "black"
- Item3D {
- anchors.fill: parent
- id: solo
- objectName: "soloItem"
- y: 1
- scale: 0.3
- transform: [ Rotation3D { axis: "1,0,0"; angle: -90 }, Rotation3D { axis: "0,1,0"; angle: 60 }]
- mesh: Mesh { source: "meshes/robot.3ds"; dumpInfo: true; options: "ForceFaceted" }
- }
- Rectangle {
- id: instructions
- height: 80
- width: parent.width
- anchors.bottom: parent.bottom
- color: "#3333aa"
- opacity: 0.5
- Text {
- id: instructionsText
- wrapMode: "WordWrap"
- text: "Pick a cube, check log output. Drag in the black area to move all cubes."
- anchors.centerIn: parent
- }
- }
-}
diff --git a/tests/manual/icon.png b/tests/manual/icon.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/icon.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
deleted file mode 100644
index f6ff91c8..00000000
--- a/tests/manual/manual.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += displaymodel \
- model3ds \
- navigation1 \
- rotation \
- scaling \
- submesh \
- translation \
- transformations \
- animations \
- qrc \
- basic \
- background \
- fullreferencing \
- shapes
diff --git a/tests/manual/model3ds/README b/tests/manual/model3ds/README
deleted file mode 100644
index 63630c78..00000000
--- a/tests/manual/model3ds/README
+++ /dev/null
@@ -1,12 +0,0 @@
-
-This test renders a series of 3ds files to exercise currently supported functionality.
-
-The first model is comprised of a single mesh with no materials.
-
-The second model is a single mesh with coloured materials.
-
-The third mesh is a heirarchic mesh with no materials.
-
-The fourth mesh is a heirarchic mesh with colours/textures.
-
-All meshes should be lit & shaded, and can be manually rotated etc. as per QtQuick3D norms.
diff --git a/tests/manual/model3ds/icon-l-qtquick3d.png b/tests/manual/model3ds/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/model3ds/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/info.json b/tests/manual/model3ds/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/model3ds/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/model3ds/m5-tst_submesh_qml.desktop b/tests/manual/model3ds/m5-tst_submesh_qml.desktop
deleted file mode 100644
index 537f1e8c..00000000
--- a/tests/manual/model3ds/m5-tst_submesh_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_submesh
-Comment=Qt3D test application
-Exec=/usr/bin/tst_submesh -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/model3ds/main.cpp b/tests/manual/model3ds/main.cpp
deleted file mode 100644
index a82f9adf..00000000
--- a/tests/manual/model3ds/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_model3ds.qml")
diff --git a/tests/manual/model3ds/model3ds.pro b/tests/manual/model3ds/model3ds.pro
deleted file mode 100644
index add17572..00000000
--- a/tests/manual/model3ds/model3ds.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_model3ds
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/model3ds/model3ds.qmlproject b/tests/manual/model3ds/model3ds.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/model3ds/model3ds.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/model3ds/model3ds.qrc b/tests/manual/model3ds/model3ds.qrc
deleted file mode 100644
index 6dbd8edd..00000000
--- a/tests/manual/model3ds/model3ds.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/tst_model3ds.qml</file>
- <file>qml/meshes/lunar-lander.3ds</file>
- <file>qml/meshes/monkey.3ds</file>
- <file>qml/meshes/penguin.3ds</file>
- <file>qml/meshes/robot.3ds</file>
- <file>qml/meshes/hazard.png</file>
- </qresource>
-</RCC>
diff --git a/tests/manual/model3ds/mt.qml b/tests/manual/model3ds/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/model3ds/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/model3ds/qml/desktop.qml b/tests/manual/model3ds/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/model3ds/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/model3ds/qml/meshes/hazard.png b/tests/manual/model3ds/qml/meshes/hazard.png
deleted file mode 100644
index a7c0b7fe..00000000
--- a/tests/manual/model3ds/qml/meshes/hazard.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/qml/meshes/lunar-lander.3ds b/tests/manual/model3ds/qml/meshes/lunar-lander.3ds
deleted file mode 100644
index 7403fdef..00000000
--- a/tests/manual/model3ds/qml/meshes/lunar-lander.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/qml/meshes/monkey.3ds b/tests/manual/model3ds/qml/meshes/monkey.3ds
deleted file mode 100644
index e9a007b2..00000000
--- a/tests/manual/model3ds/qml/meshes/monkey.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/qml/meshes/penguin.3ds b/tests/manual/model3ds/qml/meshes/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/tests/manual/model3ds/qml/meshes/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/qml/meshes/robot.3ds b/tests/manual/model3ds/qml/meshes/robot.3ds
deleted file mode 100644
index ed872c82..00000000
--- a/tests/manual/model3ds/qml/meshes/robot.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/qml/tst_model3ds.qml b/tests/manual/model3ds/qml/tst_model3ds.qml
deleted file mode 100644
index 31cb9915..00000000
--- a/tests/manual/model3ds/qml/tst_model3ds.qml
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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-17392 / QTBUG-17391
-Item {
- id: screen
- width: 720
- height: 480
-
- //ITEM 1: Simple model without materials
- Rectangle {
- id: panel1
- x: 0; y:0
- width: screen.width/4
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,3,15)}
-
- Item3D {
- scale: 2
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/monkey.3ds"}
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text1.height + 10
- Text {
- id: text1
- width: parent.width
- wrapMode: "WordWrap"
- text: " MULTI-COMPONENT: No\n MATERIALS: None\n\n A grey shaded monkey head\n should be visible.\n\n Use mouse to rotate/zoom."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 2: Simple model with materials
- Rectangle {
- id: panel2
- anchors.left: panel1.right
- anchors.top: parent.top
- width: screen.width/4
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,3,15)}
-
- Item3D {
- scale: 0.8
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/penguin.3ds"}
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text2.height + 10
- Text {
- id: text2
- width: parent.width
- wrapMode: "WordWrap"
- text: " MULTI-COMPONENT: No\n MATERIALS: Yes\n\n A coloured, lit penguin\n should be visible.\n\n Use mouse to rotate/zoom."
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 3: A complex model without materials
- Rectangle {
- id: panel3
- anchors.left: panel2.right
- anchors.top: parent.top
- width: screen.width/4
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
-
- Item3D {
- scale: 0.4
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/lunar-lander.3ds"}
- }
- }
- //text for item3
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text3.height + 10
- Text {
- id: text3
- width: parent.width
- wrapMode: "WordWrap"
- text: " MULTI-COMPONENT: Yes\n MATERIALS: None\n\n A grey shaded lunar lander\n should be visible.\n\n Use mouse to rotate/zoom."
- anchors.centerIn: parent
- }
- }
- }
- //ITEM 4: A Complex model with materials
- Rectangle {
- id: panel4
- anchors.left: panel3.right
- anchors.top: parent.top
- width: screen.width/4
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,0,10)}
-
- Item3D {
- scale: 0.4
- position: Qt.vector3d(0,-2,0)
-
- transform: [
- Rotation3D {id: correct; angle: 90; axis: Qt.vector3d(0,1,0)},
- Rotation3D {id: pitch; angle: -90; axis: Qt.vector3d(0,0,1)},
- Rotation3D {id: roll; angle: 0; axis: Qt.vector3d(1,0,0)},
- Rotation3D {id: yaw; angle: 0; axis: Qt.vector3d(0,1,0)}
- ]
-
- mesh: Mesh {source: "meshes/robot.3ds"}
- }
- }
- //text for item4
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text4.height + 10
- Text {
- id: text4
- width: parent.width
- wrapMode: "WordWrap"
- text: " MULTI-COMPONENT: Yes\n MATERIALS: Yes\n\n A lit, coloured, textured robot\n should be visible.\n\n Use mouse to rotate/zoom."
- anchors.centerIn: parent
- }
- }
- }
-}
-
-
diff --git a/tests/manual/model3ds/tst_submesh_qml.desktop b/tests/manual/model3ds/tst_submesh_qml.desktop
deleted file mode 100644
index 361fd36e..00000000
--- a/tests/manual/model3ds/tst_submesh_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_submesh
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_submesh -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_submesh_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/navigation1/README b/tests/manual/navigation1/README
deleted file mode 100644
index 29aaad44..00000000
--- a/tests/manual/navigation1/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This tests navigation, specifically zooming and rotating the object using the default
-navigation configuration for QML applications.
-
-The first panel shows a 3D monkey head, and uses positional zooming: zooming in will
-move the camera physically closer to the object until it is clipped by the near plane.
-
-The second panel show a 3D monkey head, and uses field of view zooming: zooming is
-based on adjusting the field of view: zooming in will not clip the object.
diff --git a/tests/manual/navigation1/icon-l-qtquick3d.png b/tests/manual/navigation1/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/navigation1/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/navigation1/info.json b/tests/manual/navigation1/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/navigation1/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/navigation1/main.cpp b/tests/manual/navigation1/main.cpp
deleted file mode 100644
index 3c82c659..00000000
--- a/tests/manual/navigation1/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_navigation1.qml")
diff --git a/tests/manual/navigation1/mt.qml b/tests/manual/navigation1/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/navigation1/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/navigation1/navigation1.pro b/tests/manual/navigation1/navigation1.pro
deleted file mode 100644
index 025937a8..00000000
--- a/tests/manual/navigation1/navigation1.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_navigation1
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/navigation1/navigation1.qmlproject b/tests/manual/navigation1/navigation1.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/navigation1/navigation1.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/navigation1/qml/desktop.qml b/tests/manual/navigation1/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/navigation1/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/navigation1/qml/meshes/monkey.3ds b/tests/manual/navigation1/qml/meshes/monkey.3ds
deleted file mode 100644
index e9a007b2..00000000
--- a/tests/manual/navigation1/qml/meshes/monkey.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/navigation1/qml/tst_navigation1.qml b/tests/manual/navigation1/qml/tst_navigation1.qml
deleted file mode 100644
index e259147c..00000000
--- a/tests/manual/navigation1/qml/tst_navigation1.qml
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 TEST
-Item {
- id: screen
- width: 720
- height: 480
-
- //ITEM 1: Simple model without materials
- Rectangle {
- id: panel1
- x: 0; y:0
- width: screen.width/2
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- camera: Camera { eye: Qt.vector3d(0,3,15)}
-
- Item3D {
- scale: 2
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/monkey.3ds"}
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text1.height + 10
- Text {
- id: text1
- width: parent.width
- wrapMode: "WordWrap"
- text: " POSITIONAL ZOOM:\n\n" +
- " A shaded lit monkey head should\n"+
- " be displayed. Left click-and-hold" +
- " & move mouse to rotate.\n\n" +
- " Wheel to zoom. Zooming in should\n"+
- " result in eventual clipping.";
- anchors.centerIn: parent
- }
- }
- }
-
- //ITEM 2: Simple model with materials
- Rectangle {
- id: panel2
- anchors.left: panel1.right
- anchors.top: parent.top
- anchors.right: parent.right
- height: screen.height
- border.width: 3
- color: "#3333aa"
-
- Viewport {
- anchors.fill: parent
- fovzoom: true
- camera: Camera { eye: Qt.vector3d(0,3,15)}
-
- Item3D {
- scale: 2
- position: Qt.vector3d(0,-1,0)
- mesh: Mesh {source: "meshes/monkey.3ds"}
- }
- }
-
- Rectangle {
- border.width: 3; radius: 5
- width: parent.width
- height: text2.height + 10
- Text {
- id: text2
- width: parent.width
- wrapMode: "WordWrap"
- text: " FIELD-OF-VIEW ZOOM:\n\n" +
- " A shaded lit monkey head should\n"+
- " be displayed. Left click-and-hold" +
- " & move mouse to rotate.\n\n" +
- " Wheel to zoom. Zooming in should\n"+
- " not result in eventual clipping.";
- anchors.centerIn: parent
- }
- }
- }
-}
-
-
diff --git a/tests/manual/qrc/README b/tests/manual/qrc/README
deleted file mode 100644
index 8adbd818..00000000
--- a/tests/manual/qrc/README
+++ /dev/null
@@ -1,4 +0,0 @@
-Test is to make sure that the qrc: loaders don't change their functionality
-between releases.
-
-Both left and right cubes should be non-rotating and textured with Qt logo.
diff --git a/tests/manual/qrc/icon-l-qtquick3d.png b/tests/manual/qrc/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/qrc/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/qrc/m5-tst_qrc_qml.desktop b/tests/manual/qrc/m5-tst_qrc_qml.desktop
deleted file mode 100644
index 1484a0ff..00000000
--- a/tests/manual/qrc/m5-tst_qrc_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_submesh
-Comment=Qt3D test application
-Exec=/usr/bin/tst_qrc -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/qrc/main.cpp b/tests/manual/qrc/main.cpp
deleted file mode 100644
index 2e7dd2a2..00000000
--- a/tests/manual/qrc/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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/QGuiApplication>
-#include <QtQuick/qquickview.h>
-
-int main(int argc, char *argv[])
-{
- QGuiApplication app(argc, argv);
-
- QSurfaceFormat format;
- format.setSamples(16);
-
- QWindow root;
- root.resize(640 * 2, 480);
-
- QQuickView viewL(&root);
- viewL.setFormat(format);
- viewL.setSource(QUrl("qrc:///qml/cube.qml"));
- viewL.setGeometry(0, 0, 640, 480);
-
- QQuickView viewR(&root);
- viewR.setFormat(format);
- viewR.setSource(QUrl("Qrc:/qml/cube.qml"));
- viewR.setGeometry(640, 0, 640, 480);
-
- root.show();
-
- return app.exec();
-}
diff --git a/tests/manual/qrc/qml/cube.qml b/tests/manual/qrc/qml/cube.qml
deleted file mode 100644
index 89a7e669..00000000
--- a/tests/manual/qrc/qml/cube.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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$
-**
-****************************************************************************/
-//! [1]
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 640; height: 480
-
- Cube {
- scale: 1.5
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, 1, 1)
- }
-
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- decal: true
- }
- }
-}
-//! [1]
diff --git a/tests/manual/qrc/qml/qtlogo.png b/tests/manual/qrc/qml/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/tests/manual/qrc/qml/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/qrc/qrc.pro b/tests/manual/qrc/qrc.pro
deleted file mode 100644
index eb566e43..00000000
--- a/tests/manual/qrc/qrc.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = app
-TARGET = tst_qrc
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-OTHER_FILES += \
- qml/tst_cube.qml
-
-RESOURCES += \
- qrc.qrc
-
diff --git a/tests/manual/qrc/qrc.qrc b/tests/manual/qrc/qrc.qrc
deleted file mode 100644
index 168976b5..00000000
--- a/tests/manual/qrc/qrc.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/cube.qml</file>
- <file>qml/qtlogo.png</file>
- </qresource>
-</RCC>
diff --git a/tests/manual/qrc/tst_qrc_qml.desktop b/tests/manual/qrc/tst_qrc_qml.desktop
deleted file mode 100644
index aa5d520d..00000000
--- a/tests/manual/qrc/tst_qrc_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_qrc
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_qrc -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_qrc_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/rotation/icon-l-qtquick3d.png b/tests/manual/rotation/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/rotation/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/rotation/info.json b/tests/manual/rotation/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/rotation/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/rotation/m5-tst_rotation_qml.desktop b/tests/manual/rotation/m5-tst_rotation_qml.desktop
deleted file mode 100644
index 687c7ee1..00000000
--- a/tests/manual/rotation/m5-tst_rotation_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_rotation
-Comment=Qt3D test application
-Exec=/usr/bin/tst_rotation -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/rotation/main.cpp b/tests/manual/rotation/main.cpp
deleted file mode 100644
index a848d12f..00000000
--- a/tests/manual/rotation/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_rotation.qml")
diff --git a/tests/manual/rotation/mt.qml b/tests/manual/rotation/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/rotation/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/rotation/qml/TestCase.qml b/tests/manual/rotation/qml/TestCase.qml
deleted file mode 100644
index 76cc491d..00000000
--- a/tests/manual/rotation/qml/TestCase.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- property string text;
- property variant rotationAxis : Qt.vector3d(1,0,0)
- property real defaultWidth: 220
- property real defaultHeight: 150
- property variant rotation: Rotation3D {
- id: rotationTransform
- axis: rotationAxis
- PropertyAnimation on angle {
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 1500
- }
- }
- 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.top: textItem.bottom
- anchors.bottom: container.bottom
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- camera: Camera { eye: Qt.vector3d(0,15,50)}
- Teapot
- {
- id: model
- scale: 8.0
- transform: container.rotation
- }
- }
- }
-}
diff --git a/tests/manual/rotation/qml/desktop.qml b/tests/manual/rotation/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/rotation/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/rotation/qml/tst_rotation.qml b/tests/manual/rotation/qml/tst_rotation.qml
deleted file mode 100644
index 20916014..00000000
--- a/tests/manual/rotation/qml/tst_rotation.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 2.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-17408
-Item {
- id: screen
- width: aTestCase.defaultWidth * 3
- height: aTestCase.defaultHeight * 3
-
- Flow {
- anchors.fill: parent
-
- TestCase {
- id: aTestCase
- text: "Rotation: X axis\n(Rolling towards you)"
- rotationAxis: Qt.vector3d(1,0,0)
- }
-
- TestCase {
- text: "Rotation on Y Axis\n(Cube front rotating left to right)"
- rotationAxis: Qt.vector3d(0,1,0)
- }
-
- TestCase {
- text: "Rotation: Z axis\n(Rolling to the left)"
- rotationAxis: Qt.vector3d(0,0,1)
- }
-
-
- TestCase {
- text: "Rotation: -X axis\n(Rolling away)"
- rotationAxis: Qt.vector3d(-1,0,0)
- }
-
- TestCase {
- text: "Rotation on -Y Axis\n(Cube front rotating right to left)"
- rotationAxis: Qt.vector3d(0,-1,0)
- }
-
- TestCase {
- text: "Rotation: -Z axis\n(Rolling to the right)"
- rotationAxis: Qt.vector3d(0,0,-1)
- }
-
- TestCase {
- text: "Rotation: 3 axis\n(top-right-front corner stationary)"
- rotationAxis: Qt.vector3d(1,1,1)
- }
-
- TestCase {
- text: "Axis Normalization\n(Identical to previous case)"
- rotationAxis: Qt.vector3d(12.3,12.3,12.3)
- }
-
- TestCase {
- text: "Degenerate Axis\n(Anything but a crash is ok)"
- rotationAxis: Qt.vector3d(0,0,0)
- }
- }
-}
diff --git a/tests/manual/rotation/rotation.pro b/tests/manual/rotation/rotation.pro
deleted file mode 100644
index e154ee1d..00000000
--- a/tests/manual/rotation/rotation.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_rotation
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/rotation/rotation.qmlproject b/tests/manual/rotation/rotation.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/rotation/rotation.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/rotation/tst_rotation_qml.desktop b/tests/manual/rotation/tst_rotation_qml.desktop
deleted file mode 100644
index e5675b13..00000000
--- a/tests/manual/rotation/tst_rotation_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_rotation
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_rotation -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_rotation_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/scaling/icon-l-qtquick3d.png b/tests/manual/scaling/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/scaling/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/scaling/info.json b/tests/manual/scaling/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/scaling/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/scaling/m5-tst_scaling_qml.desktop b/tests/manual/scaling/m5-tst_scaling_qml.desktop
deleted file mode 100644
index 7b9cc943..00000000
--- a/tests/manual/scaling/m5-tst_scaling_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_scaling
-Comment=Qt3D test application
-Exec=/usr/bin/tst_scaling -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/scaling/main.cpp b/tests/manual/scaling/main.cpp
deleted file mode 100644
index 5e84cbde..00000000
--- a/tests/manual/scaling/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_scaling.qml")
diff --git a/tests/manual/scaling/mt.qml b/tests/manual/scaling/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/scaling/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/scaling/qml/ScalingTestCase.qml b/tests/manual/scaling/qml/ScalingTestCase.qml
deleted file mode 100644
index fe83e412..00000000
--- a/tests/manual/scaling/qml/ScalingTestCase.qml
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 testTransform: defaultTransform
- property real scaleFactor: 1.0
- property variant scaleVectorA: Qt.vector3d(1,1,1)
- property variant scaleVectorB: Qt.vector3d(1,1,1)
- property variant camera: defaultCamera
-
- // Default values:
- property variant defaultCamera: Camera { eye: Qt.vector3d(0,5,5)}
- property real defaultWidth: 220
- property real defaultHeight: 150
- property variant defaultTransform: Scale3D {
- scale: Qt.vector3d((scaleVectorA.x * animationFactor +
- scaleVectorB.x * (1.0 - animationFactor)),
- scaleVectorA.y * animationFactor +
- scaleVectorB.y * (1.0 - animationFactor),
- scaleVectorA.z * animationFactor +
- scaleVectorB.z * (1.0 - animationFactor))
- property real animationFactor: 1.0
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 1.0
- to: 0.0
- duration: 2000
- }
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: 2000
- }
- }
- }
-
- 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
- scale: container.scaleFactor
- transform: container.testTransform
- }
- }
- }
-}
diff --git a/tests/manual/scaling/qml/desktop.qml b/tests/manual/scaling/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/scaling/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/scaling/qml/tst_scaling.qml b/tests/manual/scaling/qml/tst_scaling.qml
deleted file mode 100644
index 9f978682..00000000
--- a/tests/manual/scaling/qml/tst_scaling.qml
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
- property variant scalingCamera: Camera {eye: Qt.vector3d(0,20,20) }
-
- Flow {
- anchors.fill: parent
-
- ScalingTestCase {
- id: aTestCase
- text: "Scaling up"
- camera: scalingCamera
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(4,4,4)
- }
-
- ScalingTestCase {
- text: "Scaling down"
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(0.1,0.1,0.1)
- }
-
- ScalingTestCase {
- text: "Scaling using real\n(scaling and inversion)"
- testTransform: Scale3D {}
- camera: scalingCamera
- scaleFactor: 1
- SequentialAnimation on scaleFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: -3
- to: 3
- duration: 1500
- }
- PropertyAnimation {
- from: 3
- to: -3
- duration: 1500
- }
- }
- }
-
- ScalingTestCase {
- text: "Scaling in X\n(mirroring horizontally)"
- camera: scalingCamera
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(4,1,1)
- }
-
- ScalingTestCase {
- text: "Scaling in Y\n(stretching vertically)"
- camera: scalingCamera
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(1,4,1)
- }
-
- ScalingTestCase {
- text: "Scaling in Z\n(depth-wise)"
- camera: scalingCamera
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(1,1,4)
- }
-
- ScalingTestCase {
- text: "Negative Scaling in X\n(mirroring horizontally)"
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(-1,1,1)
- }
-
- ScalingTestCase {
- text: "Negative Scaling in Y\n(flipping upside-down)"
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(1,-1,1)
- }
-
- ScalingTestCase {
- text: "Negative Scaling in Z\n(depth-wise)"
- scaleVectorA: Qt.vector3d(1,1,1)
- scaleVectorB: Qt.vector3d(1,1,-1)
- }
-
- ScalingTestCase {
- text: "Zero Z\n(Probable artifacts)"
- scaleVectorA: Qt.vector3d(1,1,0)
- scaleVectorB: Qt.vector3d(1,1,0)
- }
-
- ScalingTestCase {
- text: "Zero Y\n(Probable artifacts)"
- scaleVectorA: Qt.vector3d(1,0,1)
- scaleVectorB: Qt.vector3d(1,0,1)
- }
-
- // Skipping zero X because it would be invisible with the
- // camera position all the other tests have
-
- ScalingTestCase {
- text: "Zero Vector\n(Not visible and shouldn't crash)"
- scaleVectorA: Qt.vector3d(0,0,0)
- scaleVectorB: Qt.vector3d(0,0,0)
- }
- }
-}
diff --git a/tests/manual/scaling/scaling.pro b/tests/manual/scaling/scaling.pro
deleted file mode 100644
index 49688fe4..00000000
--- a/tests/manual/scaling/scaling.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_scaling
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/scaling/scaling.qmlproject b/tests/manual/scaling/scaling.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/scaling/scaling.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/scaling/tst_scaling_qml.desktop b/tests/manual/scaling/tst_scaling_qml.desktop
deleted file mode 100644
index 293a5fee..00000000
--- a/tests/manual/scaling/tst_scaling_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_scaling
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_scaling -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_scaling_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/shapes/README b/tests/manual/shapes/README
deleted file mode 100644
index 0d2d97a3..00000000
--- a/tests/manual/shapes/README
+++ /dev/null
@@ -1,6 +0,0 @@
-This is a basic manual test for the shapes classes in QML.
-It needs to be extended greatly to deal with level-of-detail, and the
-other properties which can be changed, such as radius and length,
-also checking on the animations of these, and creation of larger
-numbers of shapes. This last item is to confirm that only one copy
-of the geometry is created in this case.
diff --git a/tests/manual/shapes/main.cpp b/tests/manual/shapes/main.cpp
deleted file mode 100644
index fa785e2f..00000000
--- a/tests/manual/shapes/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_shapes.qml")
diff --git a/tests/manual/shapes/qml/tst_shapes.qml b/tests/manual/shapes/qml/tst_shapes.qml
deleted file mode 100644
index e402e90d..00000000
--- a/tests/manual/shapes/qml/tst_shapes.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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
-
-Item {
- id: screen
- width: 720
- height: 480
- Rectangle {
- id: description
- border.width: 3
- radius: 5
- width: parent.width
- height: text.height + 10
- Text {
- id: text
- width: parent.width
- wrapMode: "WordWrap"
- text: "There should be a green cylinder on the left, a beige sphere in the middle,\n" +
- "and a red capsule on the right hand side.\n\n" +
- "They should be the same diameter, but the capsule & cylinder twice the height.\n" +
- "The capsule and cylinder should be oriented with their length vertically.\n" +
- "Click & drag in the window to rotate the objects to confirm."
- anchors.centerIn: parent
- }
- }
- Rectangle {
- width: parent.width
- anchors.top: description.bottom
- anchors.bottom: screen.bottom
- anchors.left: screen.left
- anchors.right: screen.right
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- showSceneGraph: true
- Cylinder {
- x: -2.2
- y: 1.5
- transform: Rotation3D { axis: "1, 0, 0"; angle: 90 }
- length: 3
- effect: Effect { color: "green" }
- }
- Sphere {
- effect: Effect { color: "burlywood" }
- }
- Capsule {
- x: 2.2
- length: 3
- transform: Rotation3D { axis: "1, 0, 0"; angle: 90 }
- effect: Effect { color: "red" }
- }
- }
- }
-}
diff --git a/tests/manual/shapes/qtquick3d.png b/tests/manual/shapes/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/shapes/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/shapes/shapes.pro b/tests/manual/shapes/shapes.pro
deleted file mode 100644
index ba944a4b..00000000
--- a/tests/manual/shapes/shapes.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_shapes
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/shapes/tst_shapes_qml.desktop b/tests/manual/shapes/tst_shapes_qml.desktop
deleted file mode 100644
index 7bd7fd92..00000000
--- a/tests/manual/shapes/tst_shapes_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_submesh
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_submesh -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_submesh_qml
diff --git a/tests/manual/submesh/README b/tests/manual/submesh/README
deleted file mode 100644
index 4dc84f04..00000000
--- a/tests/manual/submesh/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-This test renders a lander model and submeshes to validate functionality.
-A radar dish submesh is stripped off, and duplicated three times.
-One instance rotates near the original position on the lander.
-If the submesh is not successfully removed from the model, there will be a second
-stationary dish underneath/near this rotating dish.
-A second model moves left and right, and should appear close to the right of lander.
-The third dish is testing scaling. Because of the way the scaling works, it may also appear to
-be moving left and right, and this is acceptable.
diff --git a/tests/manual/submesh/icon-l-qtquick3d.png b/tests/manual/submesh/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/submesh/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/submesh/info.json b/tests/manual/submesh/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/submesh/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/submesh/m5-tst_submesh_qml.desktop b/tests/manual/submesh/m5-tst_submesh_qml.desktop
deleted file mode 100644
index 537f1e8c..00000000
--- a/tests/manual/submesh/m5-tst_submesh_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_submesh
-Comment=Qt3D test application
-Exec=/usr/bin/tst_submesh -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/submesh/main.cpp b/tests/manual/submesh/main.cpp
deleted file mode 100644
index 3ebf514a..00000000
--- a/tests/manual/submesh/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_submesh.qml")
diff --git a/tests/manual/submesh/mt.qml b/tests/manual/submesh/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/submesh/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/submesh/qml/desktop.qml b/tests/manual/submesh/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/submesh/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/submesh/qml/meshes/lunar-lander.3ds b/tests/manual/submesh/qml/meshes/lunar-lander.3ds
deleted file mode 100644
index 7403fdef..00000000
--- a/tests/manual/submesh/qml/meshes/lunar-lander.3ds
+++ /dev/null
Binary files differ
diff --git a/tests/manual/submesh/qml/tst_submesh.qml b/tests/manual/submesh/qml/tst_submesh.qml
deleted file mode 100644
index 39967c1e..00000000
--- a/tests/manual/submesh/qml/tst_submesh.qml
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
-
-// QTBUG-17418
-Item {
- id: screen
- width: 720
- height: 480
- Rectangle {
- id: description
- border.width: 3
- radius: 5
- property variant radarPostion: recieverItem.localToWorld();
- x: radarPostion.x * view.width
- width: parent.width
- height: text.height + 10
- Text {
- id: text
- width: parent.width
- wrapMode: "WordWrap"
- text: "There should be a stationary lander model with a rotating radar dish attached. \n" +
- "The lander and attached radar dish should show no scaling or translation.\n" +
- "There should be a second radar dish colored red, oscillating horizontally without scaling.\n" +
- "There should be a third radar dish colored blue, scaling but not rotating.. \n" +
- "It is acceptable if the scaling dish appears to be moving due to the scaling."
- anchors.centerIn: parent
- }
- }
- Rectangle {
- width: parent.width
- anchors.top: description.bottom
- anchors.bottom: screen.bottom
- anchors.left: screen.left
- anchors.right: screen.right
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- // showPicking: true
- camera: Camera { eye: Qt.vector3d(0,15,50)}
-
- Effect {
- id: redEffect; material: red
- objectName: "redEffect"
- }
-
- Effect {
- id: blueEffect; material: blue
- objectName: "blueEffect"
- }
-
- Mesh {
- id:landerMesh
- source: "meshes/lunar-lander.3ds"
- }
-
- // A second lander mesh so we can have two different colors
- Mesh {
- id:landerMesh2
- source: "meshes/lunar-lander.3ds"
- }
-
- Item3D {
- mesh: landerMesh
- objectName: "lander"
- effect: Effect { material: green ; objectName: "greenEffect"}
- Item3D {
- // Correct context loss from "pulling off" of graph
- transform: [
- Rotation3D { axis: Qt.vector3d(1.0, 0.0, 0.0) ; angle: -90},
- Rotation3D {
- id: radarSpin2 ; axis: Qt.vector3d(0.0, 1.0, 0.0);
- angle: 0
- origin: Qt.vector3d(0.55,0.0,0.0)
- NumberAnimation on angle {
- running: true; loops: Animation.Infinite
- from: 360; to: 0; duration: 3000;
- }
- }
- ]
- Item3D { mesh: landerMesh; meshNode: "Rod.001" }
- Item3D { mesh: landerMesh; meshNode: "Receiver.001" }
- Item3D { mesh: landerMesh; meshNode: "Dish.001" }
- }
- }
-
- Item3D {
- // Check that you can duplicate items
- id: scalingRadarDish
- SequentialAnimation on scale {
- loops: Animation.Infinite; running: true
- NumberAnimation { from:1.0 ; to: 3.0; duration: 500 }
- NumberAnimation { from:3.0 ; to: 1.0; duration: 500 }
- }
- // rotate object to remove ambiguity - scaling causes
- // movement, and if this is in the z axis, the scaling
- // could be confused with perspective.
- position: Qt.vector3d(3.0,0.0,0.0)
- transform: Rotation3D {
- axis: Qt.vector3d(0.0,1.0,0.0)
- angle: -90
- }
- Material {
- // Distinctive green Color
- id: green
- ambientColor: "#448844"
- diffuseColor: "#88EE44"
- specularColor: "#88FF88"
- shininess: 200
- }
-
- 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
- }
-
- Item3D { mesh: landerMesh2; meshNode: "Rod.001"
- effect: blueEffect
- }
- Item3D { id: recieverItem; mesh: landerMesh2; meshNode: "Receiver.001" ;
- effect: blueEffect
- }
- Item3D { mesh: landerMesh2; meshNode: "Dish.001" ;
- effect: blueEffect
- }
- }
- Item3D {
- // Check that you can duplicate items
- id: translatingRadarDish
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: 0.0; to: 5.0 ; duration: 600 }
- NumberAnimation { from: 5.0; to: 0.0 ; duration: 600 }
- }
-
- Item3D { mesh: landerMesh; meshNode: "Rod.001";
- effect: redEffect
- objectName: "Rod"
- }
- Item3D { mesh: landerMesh; meshNode: "Receiver.001";
- effect: redEffect
- objectName: "Receiver"
- }
- Item3D { mesh: landerMesh; meshNode: "Dish.001";
- effect: redEffect
- objectName: "Dish"
- }
- }
- }
- }
-}
diff --git a/tests/manual/submesh/submesh.pro b/tests/manual/submesh/submesh.pro
deleted file mode 100644
index c0289024..00000000
--- a/tests/manual/submesh/submesh.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_submesh
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/submesh/submesh.qmlproject b/tests/manual/submesh/submesh.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/submesh/submesh.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/submesh/tst_submesh_qml.desktop b/tests/manual/submesh/tst_submesh_qml.desktop
deleted file mode 100644
index 361fd36e..00000000
--- a/tests/manual/submesh/tst_submesh_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_submesh
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_submesh -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_submesh_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/manual/transformations/icon-l-qtquick3d.png b/tests/manual/transformations/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/transformations/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/transformations/info.json b/tests/manual/transformations/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/transformations/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/transformations/m5-tst_transformations_qml.desktop b/tests/manual/transformations/m5-tst_transformations_qml.desktop
deleted file mode 100644
index 13fc93c6..00000000
--- a/tests/manual/transformations/m5-tst_transformations_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_transformations
-Comment=Qt3D test application
-Exec=/usr/bin/tst_transformations -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/transformations/main.cpp b/tests/manual/transformations/main.cpp
deleted file mode 100644
index 5f4a9567..00000000
--- a/tests/manual/transformations/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_transformations.qml")
diff --git a/tests/manual/transformations/mt.qml b/tests/manual/transformations/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/transformations/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml b/tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml
deleted file mode 100644
index c1e29f3b..00000000
--- a/tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
- property string text:
- "This example nests Item3Ds with a rotation, a scale and a translate" +
- " transformation. It should show a teapot spinning anti-clockwise, " +
- "growing and moving up-right relative to the initial camera, " +
- "and then reversing.";
- property variant camera: defaultCamera
-
- // Default values:
- property variant defaultCamera: Camera { eye: Qt.vector3d(0,5,30) }
- property real defaultWidth: 440
- property real defaultHeight: 300
- property real animationFactor: 0.0
- property real animationDuration: 2000
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: animationDuration
- }
- PropertyAnimation {
- from: 1.0
- to: 0.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
-
- Item3D {
- transform: Translation3D {
- translate: Qt.vector3d(testModel.translationX,
- testModel.translationY,
- testModel.translationZ)
- }
- Item3D {
- transform: Rotation3D {
- axis: Qt.vector3d(testModel.rotationAxisX,
- testModel.rotationAxisY,
- testModel.rotationAxisZ)
- angle: testModel.rotationAngle
- }
-
- Teapot {
- id: testModel
- property real scaleX: 1 + (2.0 * animationFactor);
- property real scaleY: 1 + (2.0 * animationFactor);
- property real scaleZ: 1 + (2.0 * animationFactor);
-
- property real rotationAngle: 360.0 * animationFactor;
- property real rotationAxisX: 0.0;
- property real rotationAxisY: 0.0;
- property real rotationAxisZ: 1.0;
-
- property real translationX:
- 4 * (2.0 * (animationFactor -0.5));
- property real translationY:
- 3 * (2.0 * (animationFactor - 0.5));
- property real translationZ:
- 2 * (2.0 * (animationFactor - 0.5));
-
- transform: Scale3D {
- scale: Qt.vector3d(testModel.scaleX,
- testModel.scaleY,
- testModel.scaleZ)
- }
- }
- }
- }
- }
- }
-}
diff --git a/tests/manual/transformations/qml/TransformationListTestCase.qml b/tests/manual/transformations/qml/TransformationListTestCase.qml
deleted file mode 100644
index 449268d7..00000000
--- a/tests/manual/transformations/qml/TransformationListTestCase.qml
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
- property string text:
- "This example combines a rotation, scale and translate in one " +
- "Item3D. It should show a teapot spinning anti-clockwise, growing " +
- "and moving up-right relative to the initial camera, and then " +
- "reversing.";
- property variant camera: defaultCamera
-
- // Default values:
- property variant defaultCamera: Camera { eye: Qt.vector3d(0,5,30) }
- property real defaultWidth: 440
- property real defaultHeight: 300
- property real animationFactor: 0.0
- property real animationDuration: 2000
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: animationDuration
- }
- PropertyAnimation {
- from: 1.0
- to: 0.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: testModel
- property real scaleX: 1 + (2.0 * animationFactor);
- property real scaleY: 1 + (2.0 * animationFactor);
- property real scaleZ: 1 + (2.0 * animationFactor);
-
- property real rotationAngle: 360.0 * animationFactor;
- property real rotationAxisX: 0.0;
- property real rotationAxisY: 0.0;
- property real rotationAxisZ: 1.0;
-
- property real translationX: 4 * (2.0 * (animationFactor -0.5));
- property real translationY: 3 * (2.0 * (animationFactor - 0.5));
- property real translationZ: 0;
-
- transform: [
- Scale3D {
- scale: Qt.vector3d(testModel.scaleX,
- testModel.scaleY,
- testModel.scaleZ)
- },
- Rotation3D {
- axis: Qt.vector3d(testModel.rotationAxisX,
- testModel.rotationAxisY,
- testModel.rotationAxisZ)
- angle: testModel.rotationAngle
- },
- Translation3D {
- translate: Qt.vector3d(testModel.translationX,
- testModel.translationY,
- testModel.translationZ)
- }
- ]
- }
- }
- }
-}
diff --git a/tests/manual/transformations/qml/desktop.qml b/tests/manual/transformations/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/transformations/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/transformations/qml/tst_transformations.qml b/tests/manual/transformations/qml/tst_transformations.qml
deleted file mode 100644
index 1e7138ba..00000000
--- a/tests/manual/transformations/qml/tst_transformations.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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
-
-// QTBUG-17408
-Flickable {
-
- contentWidth: aTestCase.defaultWidth * 2
- contentHeight: aTestCase.defaultHeight * 1
-
- width: aTestCase.defaultWidth * 2
- height: aTestCase.defaultHeight * 1
-
- Flow {
- ComposedItemTransformationsTestCase {
- id: aTestCase
- focus: false
- }
-
- TransformationListTestCase {
- focus: false
- }
- }
-}
diff --git a/tests/manual/transformations/transformations.pro b/tests/manual/transformations/transformations.pro
deleted file mode 100644
index b68bdc15..00000000
--- a/tests/manual/transformations/transformations.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_transformations
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/transformations/transformations.qmlproject b/tests/manual/transformations/transformations.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/transformations/transformations.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/transformations/tst_transformations_qml.desktop b/tests/manual/transformations/tst_transformations_qml.desktop
deleted file mode 100644
index f26dac55..00000000
--- a/tests/manual/transformations/tst_transformations_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_transformations
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_transformations -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_transformations_qml
-X-MeeGo-Translation-Catalog=essentials
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/icon-l-qtquick3d.png b/tests/manual/translation/icon-l-qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/translation/icon-l-qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/translation/info.json b/tests/manual/translation/info.json
deleted file mode 100644
index 048e4756..00000000
--- a/tests/manual/translation/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Thing",
- "Subcategory": "utility",
- "MainQML": "mt.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.qtquick3d.thing",
- "Depends": {
- "com.nokia.components": "1.0",
- },
- "Summary": "Thing QML Demo"
- }
-}
diff --git a/tests/manual/translation/m5-tst_translation_qml.desktop b/tests/manual/translation/m5-tst_translation_qml.desktop
deleted file mode 100644
index aaaa76eb..00000000
--- a/tests/manual/translation/m5-tst_translation_qml.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=tst_translation
-Comment=Qt3D test application
-Exec=/usr/bin/tst_translation -fullscreen
-Icon=icon-l-qtquick3d
-Terminal=false
-Type=Application
-Categories=Development;
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
-X-Text-Domain=qt3d
-
diff --git a/tests/manual/translation/main.cpp b/tests/manual/translation/main.cpp
deleted file mode 100644
index f59c66dc..00000000
--- a/tests/manual/translation/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "../../shared/qmlres.h"
-
-QUICK3D_EXAMPLE_MAIN("qml/tst_translation.qml")
diff --git a/tests/manual/translation/mt.qml b/tests/manual/translation/mt.qml
deleted file mode 100644
index 95732fe3..00000000
--- a/tests/manual/translation/mt.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "qml"
-
-Item {
- width: 320
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/translation/qml/AxesVsVectorTestCase.qml b/tests/manual/translation/qml/AxesVsVectorTestCase.qml
deleted file mode 100644
index bedabba5..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 (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 9a41033b..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 (qt-info@nokia.com)
-**
-** This file is part of the test suite 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 9e5103a5..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 (qt-info@nokia.com)
-**
-** This file is part of the test suite 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/desktop.qml b/tests/manual/translation/qml/desktop.qml
deleted file mode 100644
index ddc8f23a..00000000
--- a/tests/manual/translation/qml/desktop.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtQuick3D examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 Nokia Corporation and its Subsidiary(-ies) 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.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "."
-
-Item {
- width: 640
- height: 480
-
- Thing {
- }
-}
diff --git a/tests/manual/translation/qml/tst_translation.qml b/tests/manual/translation/qml/tst_translation.qml
deleted file mode 100644
index c70d6a71..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 (qt-info@nokia.com)
-**
-** This file is part of the test suite 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/translation.pro b/tests/manual/translation/translation.pro
deleted file mode 100644
index eb86409d..00000000
--- a/tests/manual/translation/translation.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_translation
-CONFIG += qt warn_on
-
-QT += quick3d
-
-SOURCES += main.cpp
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
diff --git a/tests/manual/translation/translation.qmlproject b/tests/manual/translation/translation.qmlproject
deleted file mode 100644
index 37c467f1..00000000
--- a/tests/manual/translation/translation.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [".", "../../imports/"]
-}
diff --git a/tests/manual/translation/tst_translation_qml.desktop b/tests/manual/translation/tst_translation_qml.desktop
deleted file mode 100644
index 23c5ac8d..00000000
--- a/tests/manual/translation/tst_translation_qml.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_translation
-Icon=icon-l-qtquick3d
-Exec=/usr/bin/tst_translation -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_translation_qml
-X-MeeGo-Translation-Catalog=essentials
diff --git a/tests/shared/compareimage.cpp b/tests/shared/compareimage.cpp
deleted file mode 100644
index 74bf95db..00000000
--- a/tests/shared/compareimage.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "compareimage.h"
-
-//#define DEBUG_QIMAGECOMPARE
-
-#ifdef DEBUG_QIMAGECOMPARE
-#include <QDebug>
-#endif
-
-// qProportionDifferentRGBPixels compares two images and returns a float
-// between 0.0 and 1.0 indicating the proportion of pixels with a difference
-// greater than the relevant threshold in RGB space, where 0.0 indicates that
-// every pixel matches, and 1.0 indicates that no pixels match.
-//
-// For example, the RGB colors 0x0088ff and 0x000000 have a red difference
-// of 0, a green difference of 0x88, and a blue difference of 0xff. If any
-// of these values is greater than the corresponding threshold, the pixel
-// would be considered "different".
-//
-// If the images are different sizes, the function compares those pixels that
-// fall in the overlapping area. If one image is simply smaller than the
-// other, this will be the size of the smaller image.
-
-float qProportionDifferentRGBPixels(const QImage& img1, const QImage& img2, int redThreshold, int greenThreshold, int blueThreshold, int alphaThreshold)
-{
- int result = 0;
-
- int width = qMin(img1.width(), img2.width());
- int height = qMin(img1.height(), img2.height());
- int pixelcount = 0;
-
-#ifdef DEBUG_QIMAGECOMPARE
- int sumDiff = 0;
- QImage *resultImage = new QImage (width,height,QImage::Format_RGB16);
-#endif
-
-
- for (int y = 0; y < height; y++)
- {
- for (int x = 0; x < width; x++)
- {
- QColor pix1 = img1.pixel(x,y);
- QColor pix2 = img2.pixel(x,y);
- int redDiff = qMax(pix1.red(),pix2.red()) - qMin(pix1.red(),pix2.red());
- int greenDiff = qMax(pix1.green(),pix2.green()) - qMin(pix1.green(),pix2.green());
- int blueDiff = qMax(pix1.blue(),pix2.blue()) - qMin(pix1.blue(),pix2.blue());
- int alphaDiff = qMax(pix1.alpha(),pix2.alpha()) - qMin(pix1.alpha(),pix2.alpha());
-
-#ifdef DEBUG_QIMAGECOMPARE
- QColor colorDiff;
- colorDiff.setRed(redDiff);
- colorDiff.setGreen(greenDiff);
- colorDiff.setBlue(blueDiff);
- colorDiff.setAlpha(255-alphaDiff);
- sumDiff += redDiff+greenDiff+blueDiff;
-#endif
-
- pixelcount++;
- if (redDiff > redThreshold
- || greenDiff > greenThreshold
- || blueDiff > blueThreshold
- || alphaDiff > alphaThreshold)
- {
- result++;
-#ifdef DEBUG_QIMAGECOMPARE
- resultImage->setPixel(x,y, colorDiff.rgba());
-#endif
- }
- }
- }
-#ifdef DEBUG_QIMAGECOMPARE
- qDebug() << "qimageCompare result was: " << result << "/"<<pixelcount<<" = "<< (int)(((float)result/(float)pixelcount)*100) << "%";
- qDebug() << "Sum of absolute differences was:"<< sumDiff;
- qDebug() << "Average difference per pixel was:" << (float)sumDiff/(float)pixelcount;
-#endif
- return (float)result/(float)pixelcount;
-};
-
-
-
-inline float qProportionDifferentRGBPixels(const QImage& img1, const QImage& img2, int threshold )
-{
- return qProportionDifferentRGBPixels(img1, img2, threshold, threshold, threshold);
-}
-
-bool qFuzzyCompare(const QImage& img1, const QImage& img2)
-{
- // The two images must have the same size.
- if (img1.width() != img2.width() || img1.height() != img2.height())
- return false;
-
-
- int count = 0;
- for (int y = 0; y < img1.height(); ++y) {
- for (int x = 0; x < img1.width(); ++x) {
- // Compare the top two bits of the red, green, and blue
- // values for equality. This should factor out rounding
- // errors due to 16-bit vs 32-bit conversions and so on.
- // We assume that the source images use primary colors.
- if ((img1.pixel(x, y) & 0x00C0C0C0) == (img2.pixel(x, y) & 0x00C0C0C0))
- ++count;
- }
- }
-
- // We consider the images the same if at least 95% of the
- // pixels have the same or very similar RGB values.
-
- // 64 is a rough approximation of bitwise & 0xC0
- return qProportionDifferentRGBPixels(img1, img2, 64) <= 0.05001;
- //return (count >= (img1.width() * img1.height() * 95 / 100));
-}
-
-bool qFuzzyCompare(const QImage& img1, const QColor& color)
-{
- int count = 0;
- for (int y = 0; y < img1.height(); ++y) {
- for (int x = 0; x < img1.width(); ++x) {
- if ((img1.pixel(x, y) & 0x00C0C0C0) == (color.rgb() & 0x00C0C0C0))
- ++count;
- }
- }
- return (count >= (img1.width() * img1.height() * 95 / 100));
-}
-
-
diff --git a/tests/shared/compareimage.h b/tests/shared/compareimage.h
deleted file mode 100644
index 4b2af2f3..00000000
--- a/tests/shared/compareimage.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef COMPAREIMAGE_H
-#define COMPAREIMAGE_H
-
-#include <QImage>
-#include <QColor>
-#include <limits.h>
-
-bool qFuzzyCompare(const QImage& img1, const QImage& img2);
-bool qFuzzyCompare(const QImage& img1, const QColor& color);
-
-float qProportionDifferentRGBPixels(const QImage& img1, const QImage& img2, int threshold = 0);
-float qProportionDifferentRGBPixels(const QImage& img1, const QImage& img2, int redThreshold, int greenThreshold, int blueThreshold, int alphaThreshold = INT_MAX);
-#endif
diff --git a/tests/shared/qmlres.h b/tests/shared/qmlres.h
deleted file mode 100644
index cae461b2..00000000
--- a/tests/shared/qmlres.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-
-#ifndef QMLRES_H
-#define QMLRES_H
-
-#include <QtCore/qdir.h>
-#include <QtGui/QGuiApplication>
-#include <QtQuick/QQuickView>
-
-#include <QtCore/qdebug.h>
-
-#define internal_xstr(s) internal_str(s)
-#define internal_str(s) #s
-
-/*!
- \internal
- Returns a string with the path to qml resources, including qml sources,
- 3D assets and textures. The path depends on the platform, and (for
- some platforms) whether it was installed from a package or is being run
- in a development setting.
-*/
-static QString q_get_qmldir(const QString &name)
-{
- QString qml = name;
- // try for a Linux package install first
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
-#ifdef QT3D_USE_OPT
- QDir pkgdir(QLatin1String("/opt/mt/applications/" internal_xstr(QT3D_USE_OPT)));
-#else
- QDir pkgdir(QLatin1String("/usr/share/qt5/quick3d/examples"));
-#endif
-#else
- QDir pkgdir(QLatin1String("/usr/share/qt4/quick3d/examples"));
-#endif
- QString app = QCoreApplication::applicationFilePath();
- app = app.section(QDir::separator(), -1);
- if (pkgdir.cd(app) && pkgdir.exists())
- {
- qml = pkgdir.filePath(qml);
- }
- else
- {
- // failing that try Mac (pkg & dev) next
- QDir dir(QCoreApplication::applicationDirPath());
- if (dir.path().endsWith(QLatin1String("MacOS")))
- {
- if (dir.cdUp() && dir.cd(QLatin1String("Resources"))
- && dir.exists())
- {
- qml = dir.filePath(qml);
- }
- else
- {
- qWarning("Expected app bundle with QML resources!");
- }
- }
- else
- {
- // for Windows (pkg & dev), and for Linux dev expect to find it
- // in a "resources" directory next to the binary
- if (dir.cd(QLatin1String("resources")) && dir.exists())
- {
- app = QDir::toNativeSeparators(app);
- //For windows platforms the "app" filepath should have the .exe extension removed.
- const QString winExtension = ".exe";
- if (app.right(winExtension.length()) == winExtension) {
- app = app.left(app.length() - winExtension.length());
- }
-
- //Grab just the app name itself.
- app = app.section(QDir::separator(), -1);
-
- if (dir.cd(QLatin1String("examples")) && dir.cd(app) && dir.exists())
- {
- qml = dir.filePath(qml);
- }
- else
- {
- QString msg = QLatin1String("examples");
- msg += QDir::separator();
- msg += app;
- qWarning("Expected %s directry with qml resources!", qPrintable(msg));
- }
- }
- }
- }
- return qml;
-}
-
-#define QUICK3D_EXAMPLE_MAIN(file) \
-int main(int argc, char *argv[]) \
-{ \
- QGuiApplication app(argc, argv); \
- QSurfaceFormat f; \
- f.setSamples(16); \
- QQuickView view; \
- view.setFormat(f); \
- QString qml = q_get_qmldir(QLatin1String( file )); \
- view.setSource(QUrl::fromLocalFile(qml)); \
- if (QGuiApplication::arguments().contains(QLatin1String("-maximize"))) \
- view.showMaximized(); \
- else if (QGuiApplication::arguments().contains(QLatin1String("-fullscreen"))) \
- view.showFullScreen(); \
- else \
- view.show(); \
- return app.exec(); \
-} \
-
-
-#endif // QMLRES_H
diff --git a/tests/shared/qtest_helpers.h b/tests/shared/qtest_helpers.h
deleted file mode 100644
index c2dc6570..00000000
--- a/tests/shared/qtest_helpers.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef QTEST_HELPERS_H
-#define QTEST_HELPERS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtTest/QtTest>
-#include <QtGui/qvector4d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-#include "qcolor4ub.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QTest {
- char *toString(const QVector4D &v)
- {
- char *msg = new char[128];
- qsnprintf(msg, 128, "(%0.4f, %0.4f, %0.4f, %0.4f)",
- v.x(), v.y(), v.z(), v.w());
- return msg;
- }
-
- char *toString(const QVector3D &v)
- {
- char *msg = new char[128];
- qsnprintf(msg, 128, "(%0.4f, %0.4f, %0.4f)", v.x(), v.y(), v.z());
- return msg;
- }
-
- char *toString(const QVector2D &v)
- {
- char *msg = new char[128];
- qsnprintf(msg, 128, "(%0.4f, %0.4f)", v.x(), v.y());
- return msg;
- }
-
- char *toString(const QColor4ub &c)
- {
- char *msg = new char[128];
- qsnprintf(msg, 128, "R: %0.2f, G: %0.2f, B: %0.2f, A: %0.2)",
- c.redF(), c.greenF(), c.blueF(), c.alphaF());
- return msg;
- }
-
- template<> bool qCompare<QVector4D>(const QVector4D &t1, const QVector4D &t2,
- const char *actual, const char *expected,
- const char *file, int line)
- {
- if (t1 == t2)
- {
- return compare_helper(true, "COMPARE()", file, line);
- }
- else
- {
- return compare_helper(false, "Compared QVector4D values are not the same:",
- toString(t1), toString(t2), actual, expected, file, line);
- }
- }
-
- template<> bool qCompare<QVector3D>(const QVector3D &t1, const QVector3D &t2,
- const char *actual, const char *expected,
- const char *file, int line)
- {
- if (t1 == t2)
- {
- return compare_helper(true, "COMPARE()", file, line);
- }
- else
- {
- return compare_helper(false, "Compared QVector3D values are not the same:",
- toString(t1), toString(t2), actual, expected, file, line);
- }
- }
-
- template<> bool qCompare<QVector2D>(const QVector2D &t1, const QVector2D &t2,
- const char *actual, const char *expected,
- const char *file, int line)
- {
- if (t1 == t2)
- {
- return compare_helper(true, "COMPARE()", file, line);
- }
- else
- {
- return compare_helper(false, "Compared QVector2D values are not the same:",
- toString(t1), toString(t2), actual, expected, file, line);
- }
- }
-
- template<> bool qCompare<QColor4ub>(const QColor4ub &t1, const QColor4ub &t2,
- const char *actual, const char *expected,
- const char *file, int line)
- {
- if (t1 == t2)
- {
- return compare_helper(true, "COMPARE()", file, line);
- }
- else
- {
- return compare_helper(false, "Compared QColor4ub values are not the same:",
- toString(t1), toString(t2), actual, expected, file, line);
- }
- }
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QTEST_HELPERS_H
diff --git a/tests/tests.pro b/tests/tests.pro
deleted file mode 100644
index cfab8452..00000000
--- a/tests/tests.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = manual
-include(../pkg.pri)
-!package: SUBDIRS += auto benchmarks